Skip to content

Commit

Permalink
Do not toggle relay with multi-touch or swipe
Browse files Browse the repository at this point in the history
Solves #14
  • Loading branch information
edwardtfn committed Jul 26, 2024
1 parent f7d750c commit 2091fc4
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ substitutions:
default_transition_length: 500ms
invalid_cooldown: 100ms

version: '0.0.2'
version: '0.0.3'

api:
id: api_server
Expand Down Expand Up @@ -41,7 +41,12 @@ binary_sensor:
on_click:
then:
- lambda: |-
if (sl_button_1_action->active_index().has_value() and sl_button_1_action->active_index().value() == 1)
if (sl_button_1_action->active_index().has_value() and
sl_button_1_action->active_index().value() == 1 and
!bs_multi_touch->state and
!bs_swipe_left->state and
!bs_swipe_down->state and
!bs_swipe_right->state)
sw_relay_1->toggle();
send_event_to_ha->execute("bs_button_1", "click");
on_double_click:
Expand All @@ -62,7 +67,12 @@ binary_sensor:
on_click:
then:
- lambda: |-
if (sl_button_2_action->active_index().has_value() and sl_button_2_action->active_index().value() == 1)
if (sl_button_2_action->active_index().has_value() and
sl_button_2_action->active_index().value() == 1 and
!bs_multi_touch->state and
!bs_swipe_left->state and
!bs_swipe_down->state and
!bs_swipe_right->state)
sw_relay_2->toggle();
send_event_to_ha->execute("bs_button_2", "click");
on_double_click:
Expand All @@ -82,7 +92,12 @@ binary_sensor:
on_click:
then:
- lambda: |-
if (sl_button_3_action->active_index().has_value() and sl_button_3_action->active_index().value() == 1)
if (sl_button_3_action->active_index().has_value() and
sl_button_3_action->active_index().value() == 1 and
!bs_multi_touch->state and
!bs_swipe_left->state and
!bs_swipe_down->state and
!bs_swipe_right->state)
sw_relay_3->toggle();
send_event_to_ha->execute("bs_button_3", "click");
on_double_click:
Expand All @@ -102,7 +117,12 @@ binary_sensor:
on_click:
then:
- lambda: |-
if (sl_button_4_action->active_index().has_value() and sl_button_4_action->active_index().value() == 1)
if (sl_button_4_action->active_index().has_value() and
sl_button_4_action->active_index().value() == 1 and
!bs_multi_touch->state and
!bs_swipe_left->state and
!bs_swipe_down->state and
!bs_swipe_right->state)
sw_relay_4->toggle();
send_event_to_ha->execute("bs_button_4", "click");
on_double_click:
Expand Down

0 comments on commit 2091fc4

Please sign in to comment.