diff --git a/doorbell.yaml b/doorbell.yaml index 2b1b7a3..d238bfa 100644 --- a/doorbell.yaml +++ b/doorbell.yaml @@ -37,8 +37,6 @@ switch: id: relay internal: True pin: GPIO12 - - platform: restart - name: Restart - platform: template id: chime_active name: Chime Active @@ -73,11 +71,7 @@ binary_sensor: green: 1 blue: 0.7 effect: pulse - - if: - condition: - - switch.is_on: chime_active - then: - - button.press: chime_button + - button.press: chime_button on_release: then: - light.turn_off: @@ -93,9 +87,15 @@ button: icon: mdi:bell on_press: then: - - switch.turn_on: relay - - delay: 0.3s - - switch.turn_off: relay + - if: + condition: + - switch.is_on: chime_active + then: + - switch.turn_on: relay + - delay: 0.3s + - switch.turn_off: relay + - platform: restart + name: Restart output: - platform: ledc