From 35cc0c4a8e849240c906d7fe791368573250c390 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Sat, 21 Dec 2024 21:18:54 +0100 Subject: [PATCH] Reorganize scripts for better clarity --- ...Ultimate-Easy-ESPHome_core_hw_buttons.yaml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml index f65f53d..a7bfec1 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml @@ -114,6 +114,19 @@ script: id(button_press_start_time) = 0; buttons_release->execute(); + - id: button_click_event + mode: restart + then: + - delay: + milliseconds: ${BUTTON_MULTI_CLICK_DELAY} + - lambda: |- + button_action->execute( + ("bs_button_" + std::to_string(id(button_press_button))).c_str(), + (id(click_counter) == 1 ? "click" : + (id(click_counter) == 2 ? "double_click" : + (std::to_string(id(click_counter)) + "_click").c_str())) + ); + - id: buttons_release mode: restart then: @@ -206,19 +219,6 @@ script: } id(button_press_start_time) = 0; - - id: button_click_event - mode: restart - then: - - delay: - milliseconds: ${BUTTON_MULTI_CLICK_DELAY} - - lambda: |- - button_action->execute( - ("bs_button_" + std::to_string(id(button_press_button))).c_str(), - (id(click_counter) == 1 ? "click" : - (id(click_counter) == 2 ? "double_click" : - (std::to_string(id(click_counter)) + "_click").c_str())) - ); - - id: !extend touch_swipe_left then: - script.execute: buttons_release