From c22d8eb847d70997e5867ab6ef388da358bd717a Mon Sep 17 00:00:00 2001 From: arnonh Date: Thu, 26 Dec 2024 21:13:22 +0200 Subject: [PATCH 1/2] Update tx_ultimate_easy.cpp Fix for 4 gang button position calculation reflects better the old positions --- components/tx_ultimate_easy/tx_ultimate_easy.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/tx_ultimate_easy/tx_ultimate_easy.cpp b/components/tx_ultimate_easy/tx_ultimate_easy.cpp index 640f3db..2c023bd 100644 --- a/components/tx_ultimate_easy/tx_ultimate_easy.cpp +++ b/components/tx_ultimate_easy/tx_ultimate_easy.cpp @@ -68,9 +68,9 @@ namespace esphome { if (this->gang_count_ == 1) return 1; - // Calculate button number - const uint8_t width = (TOUCH_MAX_POSITION + 1) / this->gang_count_; // Width of each button region - if (width < 1 or width > this->gang_count_) // Invalid width - and prevents division by zero + //Calculate button number Change to round up insted of truncate (integer division) + const uint8_t width = (TOUCH_MAX_POSITION + gang_count_) / this->gang_count_; // Width of each button region + if (width < 1) // Invalid width - and prevents division by zero removed "width > gang_count_" issue with 2 gang return 0; const uint8_t button = std::min( static_cast((position / width) + 1), // Convert position to button index From 01097717319c9150e885646ed6ee913369672ef5 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 26 Dec 2024 20:36:19 +0000 Subject: [PATCH 2/2] Bump version to 2024.12.20 [skip-versioning] --- versioning/VERSION | 2 +- versioning/VERSION_YAML | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/versioning/VERSION b/versioning/VERSION index 035e90a..2d5323d 100644 --- a/versioning/VERSION +++ b/versioning/VERSION @@ -1 +1 @@ -2024.12.19 +2024.12.20 diff --git a/versioning/VERSION_YAML b/versioning/VERSION_YAML index 5803b9d..a705cbf 100644 --- a/versioning/VERSION_YAML +++ b/versioning/VERSION_YAML @@ -1 +1 @@ -version: 2024.12.19 +version: 2024.12.20