Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 0 additions & 85 deletions Integrations/ESPHome/Core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -796,91 +796,6 @@ light:
}

script:
- id: play_song_1
then:
- light.turn_on:
brightness: 80%
id: rgb_light
effect: "RainbowWave"
- light.turn_on:
brightness: 60%
id: logo_light
effect: "RainbowWave"
- rtttl.play:
rtttl: !lambda 'return id(song_1).state;'
- delay: 30s
- light.turn_off: rgb_light
- light.turn_off: logo_light
- script.execute: ShouldSleep

- id: play_song_2
then:
- light.turn_on:
brightness: 80%
id: rgb_light
effect: "TwinklingWhite"
- light.turn_on:
brightness: 80%
id: logo_light
effect: "TwinklingRed"
- rtttl.play:
rtttl: !lambda 'return id(song_2).state;'
- delay: 30s
- light.turn_off: rgb_light
- light.turn_off: logo_light
- script.execute: ShouldSleep

- id: play_song_3
then:
- light.turn_on:
brightness: 80%
id: rgb_light
effect: "RedGreen"
- light.turn_on:
brightness: 60%
id: logo_light
effect: "RedGreen"
- rtttl.play:
rtttl: !lambda 'return id(song_3).state;'
- delay: 30s
- light.turn_off: rgb_light
- light.turn_off: logo_light
- script.execute: ShouldSleep

- id: play_song_4
then:
- light.turn_on:
brightness: 80%
id: rgb_light
effect: "TwinklingBlues"
- light.turn_on:
brightness: 80%
id: logo_light
effect: "TwinklingBlues"
- rtttl.play:
rtttl: !lambda 'return id(song_4).state;'
- delay: 30s
- light.turn_off: rgb_light
- light.turn_off: logo_light
- script.execute: ShouldSleep

- id: play_song_x
then:
- light.turn_on:
brightness: 80%
id: rgb_light
effect: "Sandstorm"
- light.turn_on:
brightness: 60%
id: logo_light
effect: "Sandstorm"
- rtttl.play:
rtttl: Sandstorm:d=16,o=6,b=85:e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e, 8e,e,a,e,e,e,e,8e,e,d,e,e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e,8e,e, a,e,e,e,e,8e,e,d,e,e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e,8e,e,a,e, e,e,e,8e,e,d,e
- delay: 30s
- light.turn_off: rgb_light
- light.turn_off: logo_light
- script.execute: ShouldSleep

- id: testScript
then:
- lambda: "id(runTest) = false;"
Expand Down
173 changes: 136 additions & 37 deletions Integrations/ESPHome/H-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,33 @@ script:
else:
- deep_sleep.enter:
id: deep_sleep_1
- id: !extend play_song_1

- id: play_song_1
then:
- light.turn_on:
brightness: 80%
id: rgb_light
effect: "RainbowWave"
- light.turn_on:
brightness: 60%
id: logo_light
effect: "RainbowWave"
- if:
condition:
lambda: 'return !id(rgb_light).remote_values.is_on();'
then:
- light.turn_on:
id: rgb_light
brightness: 90%
effect: "RainbowWave"
else:
- light.turn_on:
id: rgb_light
effect: "RainbowWave"
- if:
condition:
lambda: 'return !id(logo_light).remote_values.is_on();'
then:
- light.turn_on:
id: logo_light
brightness: 70%
effect: "RainbowWave"
else:
- light.turn_on:
id: logo_light
effect: "RainbowWave"
- wifi.disable:
- rtttl.play:
rtttl: !lambda 'return id(song_1).state;'
Expand All @@ -268,16 +285,32 @@ script:
- light.turn_off: logo_light
- script.execute: ShouldSleep

- id: !extend play_song_2
- id: play_song_2
then:
- light.turn_on:
brightness: 80%
id: rgb_light
effect: "TwinklingWhite"
- light.turn_on:
brightness: 80%
id: logo_light
effect: "TwinklingRed"
- if:
condition:
lambda: 'return !id(rgb_light).remote_values.is_on();'
then:
- light.turn_on:
id: rgb_light
brightness: 90%
effect: "TwinklingWhite"
else:
- light.turn_on:
id: rgb_light
effect: "TwinklingWhite"
- if:
condition:
lambda: 'return !id(logo_light).remote_values.is_on();'
then:
- light.turn_on:
id: logo_light
brightness: 80%
effect: "TwinklingRed"
else:
- light.turn_on:
id: logo_light
effect: "TwinklingRed"
- wifi.disable:
- rtttl.play:
rtttl: !lambda 'return id(song_2).state;'
Expand All @@ -287,16 +320,32 @@ script:
- light.turn_off: logo_light
- script.execute: ShouldSleep

- id: !extend play_song_3
- id: play_song_3
then:
- light.turn_on:
brightness: 80%
id: rgb_light
effect: "RedGreen"
- light.turn_on:
brightness: 60%
id: logo_light
effect: "RedGreen"
- if:
condition:
lambda: 'return !id(rgb_light).remote_values.is_on();'
then:
- light.turn_on:
id: rgb_light
brightness: 90%
effect: "RedGreen"
else:
- light.turn_on:
id: rgb_light
effect: "RedGreen"
- if:
condition:
lambda: 'return !id(logo_light).remote_values.is_on();'
then:
- light.turn_on:
id: logo_light
brightness: 70%
effect: "RedGreen"
else:
- light.turn_on:
id: logo_light
effect: "RedGreen"
- wifi.disable:
- rtttl.play:
rtttl: !lambda 'return id(song_3).state;'
Expand All @@ -306,25 +355,75 @@ script:
- light.turn_off: logo_light
- script.execute: ShouldSleep

- id: !extend play_song_4
- id: play_song_4
then:
- light.turn_on:
brightness: 80%
id: rgb_light
effect: "TwinklingBlues"
- light.turn_on:
brightness: 80%
id: logo_light
effect: "TwinklingBlues"
- if:
condition:
lambda: 'return !id(rgb_light).remote_values.is_on();'
then:
- light.turn_on:
id: rgb_light
brightness: 90%
effect: "TwinklingBlues"
else:
- light.turn_on:
id: rgb_light
effect: "TwinklingBlues"
- if:
condition:
lambda: 'return !id(logo_light).remote_values.is_on();'
then:
- light.turn_on:
id: logo_light
brightness: 80%
effect: "TwinklingBlues"
else:
- light.turn_on:
id: logo_light
effect: "TwinklingBlues"
- wifi.disable:
- rtttl.play:
rtttl: !lambda 'return id(song_4).state;'
- wifi.enable:
- delay: 30s
- light.turn_off: rgb_light
- light.turn_off: logo_light
- script.execute: ShouldSleep
- script.execute: ShouldSleep

- id: play_song_x
then:
- if:
condition:
lambda: 'return !id(rgb_light).remote_values.is_on();'
then:
- light.turn_on:
id: rgb_light
brightness: 80%
effect: "Sandstorm"
else:
- light.turn_on:
id: rgb_light
effect: "Sandstorm"
- if:
condition:
lambda: 'return !id(logo_light).remote_values.is_on();'
then:
- light.turn_on:
id: logo_light
brightness: 60%
effect: "Sandstorm"
else:
- light.turn_on:
id: logo_light
effect: "Sandstorm"
- wifi.disable:
- rtttl.play:
rtttl: Sandstorm:d=16,o=6,b=85:e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e, 8e,e,a,e,e,e,e,8e,e,d,e,e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e,8e,e, a,e,e,e,e,8e,e,d,e,e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e,8e,e,a,e, e,e,e,8e,e,d,e
- wifi.enable:
- delay: 30s
- light.turn_off: rgb_light
- light.turn_off: logo_light
- script.execute: ShouldSleep
Comment on lines +393 to +426

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Brightness inconsistency in play_song_x.

play_song_x uses 80% brightness for rgb_light (line 401), while play_song_1 through play_song_4 use 90%. If this is intentional, please disregard. Otherwise, apply this diff for consistency:

       - if:
           condition:
             lambda: 'return !id(rgb_light).remote_values.is_on();'
           then:
             - light.turn_on:
                 id: rgb_light
-                brightness: 80%
+                brightness: 90%
                 effect: "Sandstorm"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- id: play_song_x
then:
- if:
condition:
lambda: 'return !id(rgb_light).remote_values.is_on();'
then:
- light.turn_on:
id: rgb_light
brightness: 80%
effect: "Sandstorm"
else:
- light.turn_on:
id: rgb_light
effect: "Sandstorm"
- if:
condition:
lambda: 'return !id(logo_light).remote_values.is_on();'
then:
- light.turn_on:
id: logo_light
brightness: 60%
effect: "Sandstorm"
else:
- light.turn_on:
id: logo_light
effect: "Sandstorm"
- wifi.disable:
- rtttl.play:
rtttl: Sandstorm:d=16,o=6,b=85:e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e, 8e,e,a,e,e,e,e,8e,e,d,e,e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e,8e,e, a,e,e,e,e,8e,e,d,e,e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e,8e,e,a,e, e,e,e,8e,e,d,e
- wifi.enable:
- delay: 30s
- light.turn_off: rgb_light
- light.turn_off: logo_light
- script.execute: ShouldSleep
- id: play_song_x
then:
- if:
condition:
lambda: 'return !id(rgb_light).remote_values.is_on();'
then:
- light.turn_on:
id: rgb_light
brightness: 90%
effect: "Sandstorm"
else:
- light.turn_on:
id: rgb_light
effect: "Sandstorm"
- if:
condition:
lambda: 'return !id(logo_light).remote_values.is_on();'
then:
- light.turn_on:
id: logo_light
brightness: 60%
effect: "Sandstorm"
else:
- light.turn_on:
id: logo_light
effect: "Sandstorm"
- wifi.disable:
- rtttl.play:
rtttl: Sandstorm:d=16,o=6,b=85:e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e, 8e,e,a,e,e,e,e,8e,e,d,e,e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e,8e,e, a,e,e,e,e,8e,e,d,e,e,e,e,e,8e,e,e,a,a,a,a,g,g,g,d,e,e,e,e,8e,e,a,e, e,e,e,8e,e,d,e
- wifi.enable:
- delay: 30s
- light.turn_off: rgb_light
- light.turn_off: logo_light
- script.execute: ShouldSleep
🤖 Prompt for AI Agents
In Integrations/ESPHome/H-2.yaml around lines 393 to 426, the play_song_x
sequence sets rgb_light brightness to 80% while play_song_1 through play_song_4
use 90%; update the rgb_light brightness in the play_song_x then block from 80%
to 90% so it matches the other play_song handlers for consistent lighting
behavior.


packages:
core: !include Core.yaml
Loading
Loading