From fbc5cb79ccd2c701348c4ac74b2338f2ddc4d2fc Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Sun, 22 Dec 2024 01:46:28 +0100 Subject: [PATCH] Reduce `BUTTON_MULTI_CLICK_DELAY` to 250ms --- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml | 2 +- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml | 3 --- components/tx_ultimate_easy/tx_ultimate_easy.cpp | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml index 6de6fcf..20eb5a7 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml @@ -22,7 +22,7 @@ substitutions: BUTTON_CLICK_MIN_LENGTH: '50' # The minimum duration the click should last, in msec BUTTON_CLICK_MAX_LENGTH: '350' # The maximum duration the click should last, in msec - BUTTON_MULTI_CLICK_DELAY: '500' # The time to wait for another click, in msec + BUTTON_MULTI_CLICK_DELAY: '250' # The time to wait for another click, in msec BUTTON_PRESS_TIMEOUT: '10000' # Ignore if button is pressed for longer than this time, in msec BUTTON_LONG_PRESS_DELAY: '800' # The time to wait to consider a long press, in msec diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml index 9bbf7a0..e639876 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml @@ -113,9 +113,6 @@ script: - id: !extend button_click_event then: - lambda: |- - ESP_LOGW("DEBUG", "button_click_event"); - ESP_LOGW("DEBUG", " button_id: %" PRIu8, button_id); - ESP_LOGW("DEBUG", " click_count: %" PRIu8, click_count); if (click_count == 1) { // Single click if (!bs_multi_touch->state and !bs_swipe_left->state and diff --git a/components/tx_ultimate_easy/tx_ultimate_easy.cpp b/components/tx_ultimate_easy/tx_ultimate_easy.cpp index c6cce8d..640f3db 100644 --- a/components/tx_ultimate_easy/tx_ultimate_easy.cpp +++ b/components/tx_ultimate_easy/tx_ultimate_easy.cpp @@ -52,6 +52,7 @@ namespace esphome { } bool TxUltimateEasy::set_gang_count(const uint8_t gang_count) { + // Hardware supports maximum of 4 touch-sensitive buttons if (gang_count < 1 or gang_count > 4) return false; this->gang_count_ = gang_count;