diff --git a/home-assistant.yml b/home-assistant.yml index 189fe14..4b306ff 100644 --- a/home-assistant.yml +++ b/home-assistant.yml @@ -23,3 +23,7 @@ name: Couch lamp - entityId: light.desk_lightbar name: Desk Lightbar + - name: Concat scripts + ansible.builtin.assemble: + src: scripts + dest: scripts.yaml diff --git a/scripts/modes.yaml b/scripts/10.modes.yaml similarity index 100% rename from scripts/modes.yaml rename to scripts/10.modes.yaml diff --git a/scripts/android-tv.yaml b/scripts/20.android-tv.yaml similarity index 95% rename from scripts/android-tv.yaml rename to scripts/20.android-tv.yaml index ead8df5..e7b3c0e 100644 --- a/scripts/android-tv.yaml +++ b/scripts/20.android-tv.yaml @@ -1,6 +1,6 @@ tv_nintendo_switch: alias: Nintendo Switch - icon: 'mdi:nintendo-switch' + icon: mdi:nintendo-switch sequence: - service: switch.turn_on entity_id: switch.harmonyhub_play_a_game @@ -11,7 +11,7 @@ tv_nintendo_switch: entity_id: media_player.living_room tv_ps4: alias: PlayStation 4 - icon: 'mdi:sony-playstation' + icon: mdi:sony-playstation sequence: - service: switch.turn_on entity_id: switch.harmonyhub_play_ps4 @@ -22,7 +22,7 @@ tv_ps4: entity_id: media_player.living_room tv_twitch: alias: Twitch - icon: 'mdi:twitch' + icon: mdi:twitch sequence: - choose: - conditions: @@ -45,7 +45,7 @@ tv_twitch: entity_id: media_player.nvidia_shield tv_youtube: alias: YouTube - icon: 'mdi:youtube' + icon: mdi:youtube sequence: - choose: - conditions: @@ -68,7 +68,7 @@ tv_youtube: entity_id: media_player.nvidia_shield tv_netflix: alias: Netflix - icon: 'mdi:netflix' + icon: mdi:netflix sequence: - choose: - conditions: @@ -91,7 +91,7 @@ tv_netflix: entity_id: media_player.nvidia_shield tv_firefox: alias: Firefox - icon: 'mdi:firefox' + icon: mdi:firefox sequence: - choose: - conditions: @@ -114,7 +114,7 @@ tv_firefox: entity_id: media_player.nvidia_shield tv_off: alias: 'TV Off' - icon: 'mdi:power' + icon: mdi:power sequence: - service: switch.turn_off entity_id: switch.harmonyhub_play_a_game diff --git a/scripts/30.pc-sleep.yaml b/scripts/30.pc-sleep.yaml new file mode 100644 index 0000000..f9d432e --- /dev/null +++ b/scripts/30.pc-sleep.yaml @@ -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 \ No newline at end of file diff --git a/scripts/pause-all-media.yaml b/scripts/40.pause-all-media.yaml similarity index 100% rename from scripts/pause-all-media.yaml rename to scripts/40.pause-all-media.yaml