mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -31,27 +31,27 @@ action:
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.ma_girls_room_hub
|
||||
entity_id: media_player.ma_girls_room_clock
|
||||
state: "playing"
|
||||
|
||||
- action: media_player.volume_set
|
||||
data:
|
||||
volume_level: 0.4
|
||||
target:
|
||||
entity_id: media_player.ma_girls_room_hub
|
||||
entity_id: media_player.ma_girls_room_clock
|
||||
|
||||
#- action: script.goodnight_kids_youtube_music
|
||||
- action: media_player.shuffle_set
|
||||
data:
|
||||
shuffle: false
|
||||
target:
|
||||
entity_id: media_player.ma_girls_room_hub
|
||||
entity_id: media_player.ma_girls_room_clock
|
||||
|
||||
- action: media_player.repeat_set
|
||||
data:
|
||||
repeat: all
|
||||
target:
|
||||
entity_id: media_player.ma_girls_room_hub
|
||||
entity_id: media_player.ma_girls_room_clock
|
||||
|
||||
- action: music_assistant.play_media
|
||||
data:
|
||||
@@ -59,4 +59,4 @@ action:
|
||||
media_type: playlist
|
||||
enqueue: replace
|
||||
target:
|
||||
entity_id: media_player.ma_girls_room_hub
|
||||
entity_id: media_player.ma_girls_room_clock
|
||||
|
||||
@@ -89,7 +89,7 @@ action:
|
||||
sequence:
|
||||
- action: light.turn_on
|
||||
target:
|
||||
entity_id: light.girls_room_fan_light_switch_light
|
||||
entity_id: light.girls_room_hue
|
||||
|
||||
- alias: "If the room is set to auto, the lights are on, and the automatic profile is set to Nightlight, change to the Automatic Light Profile scene with a short transition"
|
||||
conditions:
|
||||
@@ -99,7 +99,7 @@ action:
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.girls_room_fan_light_switch_light
|
||||
entity_id: light.girls_room_hue
|
||||
state: "on"
|
||||
- alias: "Automatic light profile set to Nightlight"
|
||||
condition: state
|
||||
@@ -120,7 +120,7 @@ action:
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.girls_room_fan_light_switch_light
|
||||
entity_id: light.girls_room_hue
|
||||
state: "on"
|
||||
sequence:
|
||||
- action: scene.turn_on
|
||||
@@ -137,7 +137,7 @@ action:
|
||||
state: Auto
|
||||
- alias: "Lights are off"
|
||||
condition: state
|
||||
entity_id: light.girls_room_fan_light_switch_light
|
||||
entity_id: light.girls_room_hue
|
||||
state: "off"
|
||||
sequence:
|
||||
- action: scene.turn_on
|
||||
@@ -148,7 +148,7 @@ action:
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.girls_room_fan_light_switch_light
|
||||
entity_id: light.girls_room_hue
|
||||
state: "on"
|
||||
- alias: "Room set to Nightlight"
|
||||
condition: state
|
||||
@@ -165,7 +165,7 @@ action:
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.girls_room_fan_light_switch_light
|
||||
entity_id: light.girls_room_hue
|
||||
state: "on"
|
||||
sequence:
|
||||
- action: scene.turn_on
|
||||
@@ -178,7 +178,7 @@ action:
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are off"
|
||||
condition: state
|
||||
entity_id: light.girls_room_fan_light_switch_light
|
||||
entity_id: light.girls_room_hue
|
||||
state: "off"
|
||||
sequence:
|
||||
- action: scene.turn_on
|
||||
|
||||
@@ -8,4 +8,4 @@ trigger:
|
||||
|
||||
action:
|
||||
- action: media_player.turn_off
|
||||
entity_id: media_player.ma_girls_room_hub
|
||||
entity_id: media_player.ma_girls_room_clock
|
||||
|
||||
@@ -7,7 +7,7 @@ trigger:
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
entity_id: media_player.ma_girls_room_hub
|
||||
entity_id: media_player.ma_girls_room_clock
|
||||
to: "idle"
|
||||
for: 00:00:05
|
||||
|
||||
@@ -22,16 +22,16 @@ action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.ma_girls_room_hub
|
||||
entity_id: media_player.ma_girls_room_clock
|
||||
state: "playing"
|
||||
sequence:
|
||||
- action: media_player.media_stop
|
||||
target:
|
||||
entity_id: media_player.ma_girls_room_hub
|
||||
entity_id: media_player.ma_girls_room_clock
|
||||
|
||||
- action: script.search_and_play_playlist
|
||||
data:
|
||||
speaker: media_player.ma_girls_room_hub
|
||||
speaker: media_player.ma_girls_room_clock
|
||||
search_term: Clever Kids Goodnight Songs
|
||||
volume: 0.25
|
||||
repeat: all
|
||||
|
||||
Reference in New Issue
Block a user