Refactor code structure for improved readability and maintainability

This commit is contained in:
CeeWeasel
2026-01-19 14:47:59 -05:00
parent 6550521520
commit 97a0e678c0
84 changed files with 1614 additions and 1177 deletions
+9 -9
View File
@@ -1,9 +1,9 @@
alias: Cam03 on Computer Area Hub
sequence:
- action: webrtc.dash_cast
data:
entity_id: media_player.computer_area_hub
url: rtsp_cam03
force: true
extra:
mode: webrtc
# alias: Cam03 on Computer Area Hub
# sequence:
# - action: webrtc.dash_cast
# data:
# entity_id: media_player.computer_area_hub
# url: rtsp_cam03
# force: true
# extra:
# mode: webrtc
+9 -9
View File
@@ -1,9 +1,9 @@
alias: Cam03_sub on Computer Area Hub
sequence:
- action: webrtc.dash_cast
data:
entity_id: media_player.computer_area_hub
url: cam03_sub
force: true
extra:
mode: webrtc
# alias: Cam03_sub on Computer Area Hub
# sequence:
# - action: webrtc.dash_cast
# data:
# entity_id: media_player.computer_area_hub
# url: cam03_sub
# force: true
# extra:
# mode: webrtc
+8 -8
View File
@@ -1,8 +1,8 @@
alias: Cam08 on Computer Area Hub
sequence:
- action: webrtc.dash_cast
data:
entity_id: media_player.computer_area_hub
url: cam08_sub
extra:
mode: webrtc
# alias: Cam08 on Computer Area Hub
# sequence:
# - action: webrtc.dash_cast
# data:
# entity_id: media_player.computer_area_hub
# url: cam08_sub
# extra:
# mode: webrtc
+9 -9
View File
@@ -1,9 +1,9 @@
alias: Cam08 on Front Room Hub
sequence:
- action: webrtc.dash_cast
data:
entity_id: media_player.front_room_hub
url: cam08_sub
force: true
extra:
mode: webrtc
# alias: Cam08 on Front Room Hub
# sequence:
# - action: webrtc.dash_cast
# data:
# entity_id: media_player.front_room_hub
# url: cam08_sub
# force: true
# extra:
# mode: webrtc
+9 -9
View File
@@ -1,9 +1,9 @@
alias: Cam13 on Computer Area Hub
sequence:
- action: webrtc.dash_cast
data:
entity_id: media_player.computer_area_hub
url: cam13_sub
force: true
extra:
mode: webrtc
# alias: Cam13 on Computer Area Hub
# sequence:
# - action: webrtc.dash_cast
# data:
# entity_id: media_player.computer_area_hub
# url: cam13_sub
# force: true
# extra:
# mode: webrtc
+9 -9
View File
@@ -1,9 +1,9 @@
alias: Cam13 on Front Room Hub
sequence:
- action: webrtc.dash_cast
data:
entity_id: media_player.front_room_hub
url: cam13_sub
force: true
extra:
mode: webrtc
# alias: Cam13 on Front Room Hub
# sequence:
# - action: webrtc.dash_cast
# data:
# entity_id: media_player.front_room_hub
# url: cam13_sub
# force: true
# extra:
# mode: webrtc
+9 -9
View File
@@ -1,9 +1,9 @@
alias: Cam19 on Computer Area Hub
sequence:
- action: webrtc.dash_cast
data:
entity_id: media_player.computer_area_hub
url: rtsp://192.168.1.7:8554/cam19_sub
force: true
extra:
mode: webrtc
# alias: Cam19 on Computer Area Hub
# sequence:
# - action: webrtc.dash_cast
# data:
# entity_id: media_player.computer_area_hub
# url: rtsp://192.168.1.7:8554/cam19_sub
# force: true
# extra:
# mode: webrtc
+9 -9
View File
@@ -1,9 +1,9 @@
alias: Cam19 on Front Room Hub
sequence:
- action: webrtc.dash_cast
data:
entity_id: media_player.front_room_hub
url: cam19_sub
force: true
extra:
mode: webrtc
# alias: Cam19 on Front Room Hub
# sequence:
# - action: webrtc.dash_cast
# data:
# entity_id: media_player.front_room_hub
# url: cam19_sub
# force: true
# extra:
# mode: webrtc
+15 -15
View File
@@ -1,17 +1,17 @@
alias: Create temporary camera link
sequence:
- variables:
link_id: "{% for _ in range(40) %}{{ range(10)|random }}{% endfor %}"
# alias: Create temporary camera link
# sequence:
# - variables:
# link_id: "{% for _ in range(40) %}{{ range(10)|random }}{% endfor %}"
- action: webrtc.create_link
data:
link_id: "{{ link_id }}" # create a random or permanent link ID
# url: rtsp://rtsp:12345678@192.168.1.123:554/av_stream/ch0
# entity: camera.sonoff # you can use camera entity_id or url
url: rtsp://192.168.1.7:8554/cam03_sub
open_limit: 1 # how many times a link can be opened (0 - unlimit, 1 - default)
time_to_live: 60 # how many seconds will the link live (0 - unlimit, 60 - default)
# - action: webrtc.create_link
# data:
# link_id: "{{ link_id }}" # create a random or permanent link ID
# # url: rtsp://rtsp:12345678@192.168.1.123:554/av_stream/ch0
# # entity: camera.sonoff # you can use camera entity_id or url
# url: rtsp://192.168.1.7:8554/cam03_sub
# open_limit: 1 # how many times a link can be opened (0 - unlimit, 1 - default)
# time_to_live: 60 # how many seconds will the link live (0 - unlimit, 60 - default)
- action: persistent_notification.create
data:
message: '<a href="/webrtc/embed?url={{ link_id }}" target="_blank">Open Camera</a>'
# - action: persistent_notification.create
# data:
# message: '<a href="/webrtc/embed?url={{ link_id }}" target="_blank">Open Camera</a>'
+7 -7
View File
@@ -2,19 +2,19 @@ alias: House alert
sequence:
- action: media_player.turn_on
data:
entity_id: media_player.master_bedroom_clock
entity_id: media_player.bedroom_hub
- action: media_player.volume_set
data:
entity_id: media_player.master_bedroom_clock
entity_id: media_player.bedroom_hub
volume_level: 0.5
- action: media_player.play_media
data:
entity_id: media_player.master_bedroom_clock
entity_id: media_player.bedroom_hub
media_content_id: http://192.168.1.11:8123/local/audio/alarms/Alarm_Clock.mp3
media_content_type: music
- delay: "00:00:10"
# Wait for it to stop playing (5 second audio clip)
- wait_template: "{{ is_state('media_player.master_bedroom_clock','idle') }}"
- wait_template: "{{ is_state('media_player.bedroom_hub','idle') }}"
timeout: "00:00:06"
continue_on_timeout: "true"
# Send an audio alert
@@ -22,15 +22,15 @@ sequence:
target:
entity_id: tts.google_translate_en_com
data:
media_player_entity_id: media_player.master_bedroom_clock
media_player_entity_id: media_player.bedroom_hub
message: >-
{{ (expand('binary_sensor.exterior_doors') | selectattr('state', 'eq', 'off')) | map(attribute='name') | list }}
- delay: "00:00:02"
# Wait for it to stop playing (2 minute timeout)
- wait_template: "{{ is_state('media_player.master_bedroom_clock','idle') }}"
- wait_template: "{{ is_state('media_player.bedroom_hub','idle') }}"
timeout: "00:02:00"
continue_on_timeout: "true"
# Turn off the media players
- action: media_player.turn_off
data:
entity_id: media_player.master_bedroom_clock
entity_id: media_player.bedroom_hub
@@ -14,7 +14,7 @@ sequence:
- action: media_player.volume_set
target:
# entity_id: media_player.ma_home_assistant_voice_097b44_media_player
entity_id: media_player.ma_master_bedroom_clock
entity_id: media_player.ma_bedroom_hub
data:
volume_level: "{{iif(volume>1,1,volume)}}"
@@ -23,7 +23,7 @@ sequence:
entity_id: tts.google_translate_en_com
data:
# media_player_entity_id: media_player.ma_home_assistant_voice_097b44_media_player
media_player_entity_id: media_player.ma_master_bedroom_clock
media_player_entity_id: media_player.ma_bedroom_hub
#message: "Pick up the kids at 7 for Donuts with Dads! Its {{ now().strftime('%-I:%M %p') }} so you need to get out of bed and get ready for work and get the kids ready for school"
message: "You have {{ states('todo.local_to_do') }} items on your daily task list: {{ local_todo['todo.local_to_do']['items'] | map(attribute='summary') | list | join(', ') }}"
+1 -1
View File
@@ -4,7 +4,7 @@ icon: mdi:music
sequence:
- action: media_player.select_source
data:
source: girls_room_hub
source: girls_room_clock
entity_id: media_player.ytube_music_player
- action: media_player.shuffle_set
data:
@@ -4,7 +4,7 @@ icon: mdi:music
sequence:
- action: media_player.select_source
data:
source: girls_room_hub
source: girls_room_clock
entity_id: media_player.ytube_music_player
- action: media_player.shuffle_set
data: