From 2091fc4623ac95a61391719fbde288dcd136377e Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 26 Jul 2024 08:33:30 +0200 Subject: [PATCH] Do not toggle relay with multi-touch or swipe Solves #14 --- ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml | 30 ++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml index 46908c0..31595ed 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml @@ -9,7 +9,7 @@ substitutions: default_transition_length: 500ms invalid_cooldown: 100ms - version: '0.0.2' + version: '0.0.3' api: id: api_server @@ -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: @@ -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: @@ -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: @@ -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: