Fix button

This commit is contained in:
Nikolay Vasilchuk
2019-11-03 00:13:46 +03:00
parent 1b54a2885c
commit b3260cda1f

View File

@@ -147,6 +147,14 @@ script:
then: then:
- logger.log: "Set state 'Incoming call'" - logger.log: "Set state 'Incoming call'"
- script.execute: led_off - script.execute: led_off
- if:
condition:
and:
- switch.is_off: auto_open
- switch.is_off: auto_open_once
- switch.is_off: auto_reject
then:
script.execute: led_blink_red_1_on
- if: - if:
condition: condition:
switch.is_on: auto_reject switch.is_on: auto_reject
@@ -164,14 +172,6 @@ script:
- script.execute: call_accept - script.execute: call_accept
- delay: 1s - delay: 1s
- switch.turn_off: auto_open_once - switch.turn_off: auto_open_once
- if:
condition:
and:
- switch.is_off: auto_open
- switch.is_off: auto_open_once
- switch.is_off: auto_reject
then:
script.execute: led_blink_red_1_on
# Permanent blink green led with one flash # Permanent blink green led with one flash
- id: led_blink_green_1_on - id: led_blink_green_1_on
@@ -400,29 +400,19 @@ binary_sensor:
then: then:
script.execute: call_accept script.execute: call_accept
else: else:
- if: if:
condition: condition:
and: switch.is_on: auto_open_once
- switch.is_off: auto_open then:
- switch.is_off: auto_open_once switch.turn_on: auto_open
- switch.is_off: auto_reject else:
then: if:
switch.turn_on: auto_open_once condition:
- if: switch.is_on: auto_open
condition: then:
switch.is_on: auto_open_once switch.turn_on: auto_reject
then: else:
switch.turn_on: auto_open switch.turn_on: auto_open_once
- if:
condition:
switch.is_on: auto_open
then:
switch.turn_on: auto_reject
- if:
condition:
switch.is_on: auto_reject
then:
switch.turn_on: auto_open_once
# Long click - disable auto opening # Long click - disable auto opening
- timing: - timing:
- ON for at least $short_click_time_to - ON for at least $short_click_time_to