Rebuild tone_volume_change play on volume change
IDF v5.3 compatibility
This commit is contained in:
@@ -60,14 +60,11 @@ number:
|
|||||||
- speaker.volume_set:
|
- speaker.volume_set:
|
||||||
id: speaker_embedded
|
id: speaker_embedded
|
||||||
volume: !lambda return x/100.0f;
|
volume: !lambda return x/100.0f;
|
||||||
- if:
|
- lambda: |-
|
||||||
condition:
|
static const std::string tone_volume_change = "${tone_volume_change}";
|
||||||
- lambda: return x > 0;
|
// Play sound if tone_volume_change is not "none"
|
||||||
- lambda: return "${tone_volume_change}" != "none";
|
if (x > 0 and !tone_volume_change.empty() and tone_volume_change != "none")
|
||||||
then:
|
rtttl_speaker->play(tone_volume_change);
|
||||||
- rtttl.play:
|
|
||||||
id: rtttl_speaker
|
|
||||||
rtttl: "${tone_volume_change}"
|
|
||||||
|
|
||||||
rtttl:
|
rtttl:
|
||||||
- id: rtttl_speaker
|
- id: rtttl_speaker
|
||||||
|
|||||||
Reference in New Issue
Block a user