Skip to content

Commit

Permalink
Rebuild tone_volume_change play on volume change
Browse files Browse the repository at this point in the history
IDF v5.3 compatibility
  • Loading branch information
edwardtfn committed Dec 27, 2024
1 parent 9828b6f commit 0c9a5ac
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,11 @@ number:
- speaker.volume_set:
id: speaker_embedded
volume: !lambda return x/100.0f;
- if:
condition:
- lambda: return x > 0;
- lambda: return "${tone_volume_change}" != "none";
then:
- rtttl.play:
id: rtttl_speaker
rtttl: "${tone_volume_change}"
- lambda: |-
static const 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:
- id: rtttl_speaker
Expand Down

0 comments on commit 0c9a5ac

Please sign in to comment.