Skip to content

Commit ca6b845

Browse files
committed
Only confirm Ring To Open on command
1 parent f350b76 commit ca6b845

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

firmware/base.yaml

+26-16
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ esphome:
9393
blue: 95%
9494
color_brightness: 60%
9595
- delay: 3s
96-
- script.execute: reset_led
96+
- script.execute: update_led
9797

9898
# Enable logging
9999
logger:
@@ -181,23 +181,12 @@ switch:
181181
restore_mode: RESTORE_DEFAULT_OFF
182182
optimistic: true
183183
turn_on_action:
184-
- light.turn_on:
185-
id: doorman_rgb_status_led
186-
red: 100%
187-
green: 100%
188-
blue: 3%
189-
effect: slow_pulse
190-
- delay: 300ms
191-
- if:
192-
condition:
193-
- switch.is_on: doorman_ring_to_open_confirmation
194-
then:
195-
- tcs_intercom.send:
196-
command: !lambda "return id(apartment_doorbell_command);"
184+
- script.execute: update_led
197185
- script.execute: ring_to_open_timer
198186
turn_off_action:
199187
- light.turn_off: doorman_rgb_status_led
200188
- script.stop: ring_to_open_timer
189+
- script.execute: update_led
201190

202191
- platform: template
203192
name: "Ring To Open: Confirmation"
@@ -487,6 +476,14 @@ binary_sensor:
487476
lambda: !lambda "return id(ring_to_open_toggle_command);"
488477
on_press:
489478
- switch.toggle: doorman_ring_to_open
479+
- delay: 300ms
480+
- if:
481+
condition:
482+
- switch.is_on: doorman_ring_to_open
483+
- switch.is_on: doorman_ring_to_open_confirmation
484+
then:
485+
- tcs_intercom.send:
486+
command: !lambda "return id(apartment_doorbell_command);"
490487
entity_category: DIAGNOSTIC
491488
disabled_by_default: true
492489

@@ -689,10 +686,23 @@ event:
689686
- "triple"
690687

691688
script:
692-
- id: reset_led
689+
- id: update_led
693690
then:
694691
# TODO: Restore specific state conditionally
695-
- light.turn_off: doorman_rgb_status_led
692+
- if:
693+
condition:
694+
- switch.is_on: doorman_ring_to_open
695+
then:
696+
- light.turn_on:
697+
id: doorman_rgb_status_led
698+
red: 100%
699+
green: 100%
700+
blue: 3%
701+
effect: slow_pulse
702+
else:
703+
- light.turn_off:
704+
id: doorman_rgb_status_led
705+
transition_length: 1s
696706

697707
- id: ring_to_open_timer
698708
then:

0 commit comments

Comments
 (0)