Fix calls to speaker_play_click
This commit is contained in:
@@ -45,7 +45,7 @@ api:
|
||||
then:
|
||||
- lambda: |-
|
||||
rtttl_speaker->stop();
|
||||
if (rtttl_speaker_gain->state > 0) {
|
||||
if (speaker_volume->state > 0) {
|
||||
ESP_LOGI("api", "Play tone: '%s'", tone.c_str());
|
||||
rtttl_speaker->play(tone.c_str());
|
||||
}
|
||||
@@ -56,7 +56,7 @@ esphome:
|
||||
- -D TX_ULTIMATE_EASY_ADDON_SPEAKER
|
||||
|
||||
number:
|
||||
- id: rtttl_speaker_gain
|
||||
- id: speaker_volume
|
||||
name: Sound - Volume
|
||||
platform: template
|
||||
max_value: 100
|
||||
@@ -72,13 +72,9 @@ number:
|
||||
optimistic: true
|
||||
set_action:
|
||||
then:
|
||||
- lambda: |-
|
||||
rtttl_speaker->set_gain((100-(x/10.0f))/100.0f);
|
||||
std::string tone_volume_change = "${tone_volume_change}";
|
||||
// Play sound if tone_volume_change is not "none"
|
||||
if (x > 0 and !tone_volume_change.empty() and tone_volume_change != "none")
|
||||
rtttl_speaker->play(tone_volume_change);
|
||||
rtttl_speaker->dump_config();
|
||||
- speaker.volume_set:
|
||||
id: speaker_embedded
|
||||
volume: !lambda return x/100.0f;
|
||||
|
||||
rtttl:
|
||||
- id: rtttl_speaker
|
||||
@@ -124,7 +120,7 @@ script:
|
||||
then:
|
||||
- lambda: |-
|
||||
if (sl_touch_speaker_feedback->state != "Disabled")
|
||||
vibrate->execute();
|
||||
speaker_play_click->execute();
|
||||
|
||||
- id: !extend touch_on_press
|
||||
then:
|
||||
@@ -135,7 +131,7 @@ script:
|
||||
then:
|
||||
- lambda: |-
|
||||
if (sl_touch_speaker_feedback->state == "On press" or sl_touch_speaker_feedback->state == "Always")
|
||||
vibrate->execute();
|
||||
speaker_play_click->execute();
|
||||
|
||||
- id: !extend touch_on_release
|
||||
then:
|
||||
@@ -146,7 +142,7 @@ script:
|
||||
then:
|
||||
- lambda: |-
|
||||
if (sl_touch_speaker_feedback->state == "On release" or sl_touch_speaker_feedback->state == "Always")
|
||||
vibrate->execute();
|
||||
speaker_play_click->execute();
|
||||
|
||||
select:
|
||||
- id: sl_touch_speaker_feedback
|
||||
|
||||
Reference in New Issue
Block a user