diff --git a/components/tx_ultimate_easy/tx_ultimate_easy.cpp b/components/tx_ultimate_easy/tx_ultimate_easy.cpp index d3de82b..d233abf 100644 --- a/components/tx_ultimate_easy/tx_ultimate_easy.cpp +++ b/components/tx_ultimate_easy/tx_ultimate_easy.cpp @@ -69,9 +69,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 diff --git a/versioning/VERSION b/versioning/VERSION index 9ec75a4..cda1ac9 100644 --- a/versioning/VERSION +++ b/versioning/VERSION @@ -1 +1 @@ -2024.12.21 \ No newline at end of file +2024.12.21 diff --git a/versioning/VERSION_YAML b/versioning/VERSION_YAML index f338ed0..ab056b2 100644 --- a/versioning/VERSION_YAML +++ b/versioning/VERSION_YAML @@ -1 +1 @@ -version: 2024.12.21 \ No newline at end of file +version: 2024.12.21