diff --git a/home-assistant-voice.yaml b/home-assistant-voice.yaml index ad20e497..f1e0aa0b 100644 --- a/home-assistant-voice.yaml +++ b/home-assistant-voice.yaml @@ -207,6 +207,15 @@ switch: entity_category: config optimistic: true restore_mode: RESTORE_DEFAULT_ON + # Timer LED remaining time off switch + - platform: template + id: lock_buttons + name: Lock buttons + icon: "mdi:button-pointer" + entity_category: config + optimistic: true + restore_mode: RESTORE_DEFAULT_OFF + disabled_by_default: true # Internal switch to track when a timer is ringing on the device. - platform: template id: timer_ringing @@ -262,9 +271,17 @@ binary_sensor: number: GPIO0 inverted: true on_press: - - script.execute: control_leds + - if: + condition: + switch.is_off: lock_buttons + then: + - script.execute: control_leds on_release: - - script.execute: control_leds + - if: + condition: + switch.is_off: lock_buttons + then: + - script.execute: control_leds # If a factory reset is requested, factory reset on release - if: condition: @@ -285,7 +302,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(init_in_progress) && !id(color_changed); + lambda: return !id(init_in_progress) && !id(color_changed) && !id(lock_buttons).state; then: - if: condition: @@ -335,7 +352,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(init_in_progress) && !id(color_changed); + lambda: return !id(init_in_progress) && !id(color_changed) && !id(lock_buttons).state; then: - script.execute: id: play_sound @@ -356,7 +373,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(init_in_progress) && !id(color_changed); + lambda: return !id(init_in_progress) && !id(color_changed) && !id(lock_buttons).state; then: - script.execute: id: play_sound @@ -372,7 +389,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(init_in_progress) && !id(color_changed); + lambda: return !id(init_in_progress) && !id(color_changed) && !id(lock_buttons).state; then: - script.execute: id: play_sound @@ -951,7 +968,9 @@ sensor: - lambda: id(dial_touched) = true; - if: condition: - binary_sensor.is_off: center_button + and: + - binary_sensor.is_off: center_button + - switch.is_off: lock_buttons then: - script.execute: id: control_volume @@ -964,7 +983,9 @@ sensor: - lambda: id(dial_touched) = true; - if: condition: - binary_sensor.is_off: center_button + and: + - binary_sensor.is_off: center_button + - switch.is_off: lock_buttons then: - script.execute: id: control_volume