From 02b328054c39e1340ced6244936630e00caf5499 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Mon, 16 Dec 2024 01:47:20 +0100 Subject: [PATCH] Add xmassTree switch for modes --- roles/scripts/tasks/templates.yml | 8 ++++++++ .../10.modes.yaml => templates/modes.yaml.j2} | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) rename roles/scripts/{files/10.modes.yaml => templates/modes.yaml.j2} (94%) diff --git a/roles/scripts/tasks/templates.yml b/roles/scripts/tasks/templates.yml index 2a27e5f..d11d978 100644 --- a/roles/scripts/tasks/templates.yml +++ b/roles/scripts/tasks/templates.yml @@ -17,3 +17,11 @@ template: src: 'water-plants-check.yaml.j2' dest: './build/scripts/water-plants-check.yaml' + +- name: Build modes + delegate_to: localhost + template: + src: 'modes.yaml.j2' + dest: './build/scripts/modes.yaml' + vars: + xmasTree: true diff --git a/roles/scripts/files/10.modes.yaml b/roles/scripts/templates/modes.yaml.j2 similarity index 94% rename from roles/scripts/files/10.modes.yaml rename to roles/scripts/templates/modes.yaml.j2 index d9f95dd..6a51923 100644 --- a/roles/scripts/files/10.modes.yaml +++ b/roles/scripts/templates/modes.yaml.j2 @@ -79,6 +79,10 @@ good_night: - light.balcony - light.table_lamp_lights - light.lego_bookcase_light +{% if xmasTree == true %} + - light.twinkly_1 + - light.twinkly_2 +{% endif %} good_morning: alias: Good Morning @@ -99,6 +103,12 @@ good_morning: target: entity_id: input_boolean.daily_coffee - service: script.cctv_off +{% if xmasTree == true %} + - service: light.turn_on + entity_id: + - light.twinkly_1 + - light.twinkly_2 +{% endif %} - service: cover.open_cover entity_id: - cover.bedroom_blinds @@ -191,6 +201,10 @@ leave_home: - light.balcony - light.table_lamp_lights - light.lego_bookcase_light +{% if xmasTree == true %} + - light.twinkly_1 + - light.twinkly_2 +{% endif %} arrive_home: alias: Arrive Home @@ -218,3 +232,7 @@ arrive_home: - service: light.turn_on entity_id: - light.lego_bookcase_light +{% if xmasTree == true %} + - light.twinkly_1 + - light.twinkly_2 +{% endif %}