1
0

Generate scripts file from fragments

This commit is contained in:
pgrondek 2021-05-25 00:10:22 +02:00
parent f5faaf0c99
commit b4a4c3b12d
5 changed files with 58 additions and 7 deletions

View File

@ -23,3 +23,7 @@
name: Couch lamp name: Couch lamp
- entityId: light.desk_lightbar - entityId: light.desk_lightbar
name: Desk Lightbar name: Desk Lightbar
- name: Concat scripts
ansible.builtin.assemble:
src: scripts
dest: scripts.yaml

View File

@ -1,6 +1,6 @@
tv_nintendo_switch: tv_nintendo_switch:
alias: Nintendo Switch alias: Nintendo Switch
icon: 'mdi:nintendo-switch' icon: mdi:nintendo-switch
sequence: sequence:
- service: switch.turn_on - service: switch.turn_on
entity_id: switch.harmonyhub_play_a_game entity_id: switch.harmonyhub_play_a_game
@ -11,7 +11,7 @@ tv_nintendo_switch:
entity_id: media_player.living_room entity_id: media_player.living_room
tv_ps4: tv_ps4:
alias: PlayStation 4 alias: PlayStation 4
icon: 'mdi:sony-playstation' icon: mdi:sony-playstation
sequence: sequence:
- service: switch.turn_on - service: switch.turn_on
entity_id: switch.harmonyhub_play_ps4 entity_id: switch.harmonyhub_play_ps4
@ -22,7 +22,7 @@ tv_ps4:
entity_id: media_player.living_room entity_id: media_player.living_room
tv_twitch: tv_twitch:
alias: Twitch alias: Twitch
icon: 'mdi:twitch' icon: mdi:twitch
sequence: sequence:
- choose: - choose:
- conditions: - conditions:
@ -45,7 +45,7 @@ tv_twitch:
entity_id: media_player.nvidia_shield entity_id: media_player.nvidia_shield
tv_youtube: tv_youtube:
alias: YouTube alias: YouTube
icon: 'mdi:youtube' icon: mdi:youtube
sequence: sequence:
- choose: - choose:
- conditions: - conditions:
@ -68,7 +68,7 @@ tv_youtube:
entity_id: media_player.nvidia_shield entity_id: media_player.nvidia_shield
tv_netflix: tv_netflix:
alias: Netflix alias: Netflix
icon: 'mdi:netflix' icon: mdi:netflix
sequence: sequence:
- choose: - choose:
- conditions: - conditions:
@ -91,7 +91,7 @@ tv_netflix:
entity_id: media_player.nvidia_shield entity_id: media_player.nvidia_shield
tv_firefox: tv_firefox:
alias: Firefox alias: Firefox
icon: 'mdi:firefox' icon: mdi:firefox
sequence: sequence:
- choose: - choose:
- conditions: - conditions:
@ -114,7 +114,7 @@ tv_firefox:
entity_id: media_player.nvidia_shield entity_id: media_player.nvidia_shield
tv_off: tv_off:
alias: 'TV Off' alias: 'TV Off'
icon: 'mdi:power' icon: mdi:power
sequence: sequence:
- service: switch.turn_off - service: switch.turn_off
entity_id: switch.harmonyhub_play_a_game entity_id: switch.harmonyhub_play_a_game

47
scripts/30.pc-sleep.yaml Normal file
View File

@ -0,0 +1,47 @@
pc_sleep:
alias: PC Sleep
sequence:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.desktop
state: 'on'
- condition: state
entity_id: input_boolean.pc_caffeine
state: 'off'
sequence:
- service: shell_command.pc_suspend
- service: input_boolean.turn_on
target:
entity_id: input_boolean.pc_sleeping
- conditions:
- condition: state
entity_id: binary_sensor.desktop
state: 'off'
sequence: [ ]
default:
mode: single
icon: mdi:desktop-tower-monitor
pc_safe_off:
alias: PC Safe Off
sequence:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.desktop
state: 'on'
sequence:
- service: shell_command.pc_poweroff
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.desktop
to: 'off'
- service: switch.turn_off
target:
entity_id: switch.computer_outlet
default: [ ]
- service: switch.turn_off
target:
entity_id: switch.computer_outlet
mode: single
icon: mdi:desktop-tower-monitor