From 218cb3ad71e7c67c285f085dba2097eabc8ba34e Mon Sep 17 00:00:00 2001 From: joey-90 <79873908+joey-90@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:46:05 +0000 Subject: [PATCH 1/2] Add night mode switch Add switch to dim light at night. --- voice-assistant/m5stack-atom-echo.yaml | 30 +++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/voice-assistant/m5stack-atom-echo.yaml b/voice-assistant/m5stack-atom-echo.yaml index 9ebd2e18..2fe38664 100644 --- a/voice-assistant/m5stack-atom-echo.yaml +++ b/voice-assistant/m5stack-atom-echo.yaml @@ -147,10 +147,10 @@ light: script: - id: reset_led then: - - if: - condition: + condition: - switch.is_on: use_wake_word - switch.is_on: use_listen_light + - switch.is_off: night_mode then: - light.turn_on: id: led @@ -160,7 +160,21 @@ script: brightness: 100% effect: none else: - - light.turn_off: led + - if: + condition: + - switch.is_on: use_wake_word + - switch.is_on: use_listen_light + - switch.is_on: night_mode + then: + - light.turn_on: + id: led + blue: 100% + red: 100% + green: 0% + brightness: 20% + effect: none + else: + - light.turn_off: led switch: - platform: template @@ -192,6 +206,16 @@ switch: - script.execute: reset_led on_turn_off: - script.execute: reset_led + - platform: template + name: Night Mode + id: night_mode + optimistic: true + restore_mode: RESTORE_DEFAULT_ON + entity_category: config + on_turn_on: + - script.execute: reset_led + on_turn_off: + - script.execute: reset_led external_components: - source: github://pr#5230 From 4c3cbdbfcc6b7a804fa64f1faf3d825a16da0309 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Thu, 16 Nov 2023 17:01:04 +1300 Subject: [PATCH 2/2] Update voice-assistant/m5stack-atom-echo.yaml --- voice-assistant/m5stack-atom-echo.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/voice-assistant/m5stack-atom-echo.yaml b/voice-assistant/m5stack-atom-echo.yaml index 2fe38664..80b59694 100644 --- a/voice-assistant/m5stack-atom-echo.yaml +++ b/voice-assistant/m5stack-atom-echo.yaml @@ -147,7 +147,8 @@ light: script: - id: reset_led then: - condition: + - if: + condition: - switch.is_on: use_wake_word - switch.is_on: use_listen_light - switch.is_off: night_mode