Add substitution for invalid_cooldown

Solves #1479
This commit is contained in:
Edward Firmo
2023-12-28 10:34:19 +01:00
parent 501855e777
commit a49a8fc7ba

View File

@@ -9,6 +9,7 @@ substitutions:
##### DON'T CHANGE THIS ##### ##### DON'T CHANGE THIS #####
version: "4.2dev.3" version: "4.2dev.3"
temp_units: "°C" temp_units: "°C"
invalid_cooldown: "500ms"
############################# #############################
##### External components ##### ##### External components #####
@@ -957,6 +958,7 @@ binary_sensor:
on_multi_click: on_multi_click:
- timing: &long_click-timing - timing: &long_click-timing
- ON for at least 0.8s - ON for at least 0.8s
invalid_cooldown: ${invalid_cooldown}
then: then:
- logger.log: "Left button - Long click" - logger.log: "Left button - Long click"
- script.execute: - script.execute:
@@ -966,6 +968,7 @@ binary_sensor:
command: "long_click" command: "long_click"
- timing: &short_click-timing - timing: &short_click-timing
- ON for at most 0.8s - ON for at most 0.8s
invalid_cooldown: ${invalid_cooldown}
then: then:
- logger.log: "Left button - Short click" - logger.log: "Left button - Short click"
- if: - if:
@@ -988,6 +991,7 @@ binary_sensor:
command: "short_click" command: "short_click"
- timing: &hold_to_restart-timing - timing: &hold_to_restart-timing
- ON for at least 15.0s - ON for at least 15.0s
invalid_cooldown: ${invalid_cooldown}
then: then:
- switch.turn_off: screen_power - switch.turn_off: screen_power
- delay: 5s - delay: 5s
@@ -1006,6 +1010,7 @@ binary_sensor:
inverted: true inverted: true
on_multi_click: on_multi_click:
- timing: *long_click-timing - timing: *long_click-timing
invalid_cooldown: ${invalid_cooldown}
then: then:
- logger.log: "Right button - Long click" - logger.log: "Right button - Long click"
- script.execute: - script.execute:
@@ -1014,6 +1019,7 @@ binary_sensor:
component: "hw_bt_right" component: "hw_bt_right"
command: "long_click" command: "long_click"
- timing: *short_click-timing - timing: *short_click-timing
invalid_cooldown: ${invalid_cooldown}
then: then:
- logger.log: "Right button - Short click" - logger.log: "Right button - Short click"
- if: - if:
@@ -1035,6 +1041,7 @@ binary_sensor:
component: "hw_bt_right" component: "hw_bt_right"
command: "short_click" command: "short_click"
- timing: *hold_to_restart-timing - timing: *hold_to_restart-timing
invalid_cooldown: ${invalid_cooldown}
then: # Restart the panel then: # Restart the panel
- button.press: restart_nspanel - button.press: restart_nspanel