Adjusted time for HW long click

This commit is contained in:
Edward Firmo
2023-09-04 12:20:02 +02:00
parent ba166ac55b
commit c2ecffd775

View File

@@ -745,22 +745,8 @@ binary_sensor:
number: 14 number: 14
inverted: true inverted: true
on_multi_click: on_multi_click:
- timing: &double_click-timing
- ON for at most 0.8s
- OFF for at most 0.8s
- ON for at most 0.8s
- OFF for at least 0.2s
then:
- logger.log: "Left button - Double click"
- script.execute:
id: ha_button
page: !lambda return id(current_page).state;
component: "hw_bt_left"
command: "double_click"
- timing: &long_click-timing - timing: &long_click-timing
- ON for 0.8s to 2s - ON for at least 0.8s
- OFF for at least 0.5s
then: then:
- logger.log: "Left button - Long click" - logger.log: "Left button - Long click"
- script.execute: - script.execute:
@@ -768,10 +754,8 @@ binary_sensor:
page: !lambda return id(current_page).state; page: !lambda return id(current_page).state;
component: "hw_bt_left" component: "hw_bt_left"
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
- OFF for at least 0.5s
then: then:
- logger.log: "Left button - Short click" - logger.log: "Left button - Short click"
- if: - if:
@@ -794,15 +778,6 @@ binary_sensor:
number: 27 number: 27
inverted: true inverted: true
on_multi_click: on_multi_click:
- timing: *double_click-timing
then:
- logger.log: "Right button - Double click"
- script.execute:
id: ha_button
page: !lambda return id(current_page).state;
component: "hw_bt_right"
command: "double_click"
- timing: *long_click-timing - timing: *long_click-timing
then: then:
- logger.log: "Right button - Long click" - logger.log: "Right button - Long click"
@@ -811,7 +786,6 @@ binary_sensor:
page: !lambda return id(current_page).state; page: !lambda return id(current_page).state;
component: "hw_bt_right" component: "hw_bt_right"
command: "long_click" command: "long_click"
- timing: *short_click-timing - timing: *short_click-timing
then: then:
- logger.log: "Right button - Short click" - logger.log: "Right button - Short click"