Compare commits

..

8 Commits

Author SHA1 Message Date
GitHub Actions
db83050d7b Bump version to 2025.8.2 [skip-versioning] 2025-08-02 22:10:08 +00:00
Edward Firmo
d7dcc05506 Merge pull request #119 from edwardtfn/stable_tag_update
Return last position on swipe
2025-08-03 00:09:59 +02:00
Edward Firmo
b6dc915469 use main also for advanced 2025-08-02 23:55:52 +02:00
Edward Firmo
dcc68f7077 Revert defaults 2025-08-02 23:53:13 +02:00
Edward Firmo
23d28a32a3 Improved readability 2025-08-02 23:50:42 +02:00
Edward Firmo
ba8f19060f Declare variable used in the loop 2025-08-02 23:40:01 +02:00
Edward Firmo
c36af8a220 Return last position on swipe
As per #110
2025-08-02 23:26:49 +02:00
Edward Firmo
6fad9d7074 Update stable tag automatically
To make it easier to release.
I will point users to `main` instead.
2025-08-02 22:58:11 +02:00
5 changed files with 50 additions and 19 deletions

View File

@@ -55,9 +55,10 @@ jobs:
- name: Update stable tag
if: |
success() &&
github.event_name == 'workflow_dispatch' &&
inputs.update_stable
success() && (
github.event_name == 'workflow_dispatch' && inputs.update_stable ||
github.event_name == 'push'
)
run: |
# Verify version bump was successful
if [ ! -f "./versioning/VERSION" ]; then
@@ -74,7 +75,7 @@ jobs:
# Update tag
NEW_VERSION=$(cat ./versioning/VERSION)
echo "Updating stable tag to $NEW_VERSION"
git tag -fa stable -m "Update stable tag"
git tag -fa stable -m "Update stable tag to $NEW_VERSION"
git push origin stable --force
- name: Update latest tag
@@ -99,6 +100,6 @@ jobs:
# Update tag
NEW_VERSION=$(cat ./versioning/VERSION)
echo "Updating latest tag to $NEW_VERSION"
git tag -fa latest -m "Update latest tag"
git tag -fa latest -m "Update latest tag to $NEW_VERSION"
git push origin latest --force
...

View File

@@ -161,11 +161,11 @@ Follow these steps to get your TX Ultimate device up and running with ESPHome.
packages:
remote_package:
url: https://github.com/edwardtfn/TX-Ultimate-Easy
ref: stable # Or you can specify a version, like `ref: v2024.12.6` or `ref: latest` to the latest non-stable
ref: main # Or you can specify a version, like `ref: v2024.12.6` or `ref: latest`
refresh: 5min
files:
- ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml # Core (essential) packages
- ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml # Non-essential, but recommended packages
- ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml # Core (essential) packages
- ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml # Non-essential, but recommended packages
```
You can also use a specific version tag for better control over updates:
```yaml
@@ -225,14 +225,14 @@ Here's an example of the advanced configuration:
packages:
remote_package:
url: https://github.com/edwardtfn/TX-Ultimate-Easy
ref: stable # Or you can specify a version, like `ref: v2024.12.6` or `ref: latest` to the latest non-stable
ref: main # Or you can specify a version, like `ref: v2024.12.6` or `ref: latest`
refresh: 5min
files:
# Core (essential) packages
- ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml # Basic shared settings
- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml # Button logic
- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml # LED configuration
- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml # Touch panel support
- ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml # Basic shared settings
- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml # Button logic
- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml # LED configuration
- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml # Touch panel support
# Optional but recommended packages
- ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml # Relay control

View File

@@ -69,9 +69,9 @@ namespace esphome {
if (this->gang_count_ == 1)
return 1;
//Calculate button number Change to round up insted of truncate (integer division)
// Calculate button number Change to round up instead 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
if (width < 1) // Invalid width - and prevents division by zero
return 0;
const uint8_t button = std::min(
static_cast<uint8_t>((position / width) + 1), // Convert position to button index
@@ -141,8 +141,36 @@ namespace esphome {
switch (uart_received_bytes[4]) {
case TOUCH_STATE_RELEASE:
case TOUCH_STATE_MULTI_TOUCH:
return uart_received_bytes[5];
case TOUCH_STATE_SWIPE_LEFT:
case TOUCH_STATE_SWIPE_RIGHT:
// uart_received_bytes[5] indicates swipe direction:
// 12 = find last touch position (scan right to left)
// 13 = find first touch position (scan left to right)
// Bytes 6-7 contain a 10-bit bitmap of touch positions:
// Byte 7: bits 0-7 represent positions 1-8
// Byte 6: bits 0-1 represent positions 9-10
switch (uart_received_bytes[5]) {
case 12:
for (uint8_t i = 10; i > 0; i--) {
if (i > 8
? uart_received_bytes[6] & (1 << (i - 9))
: uart_received_bytes[7] & (1 << (i - 1))) {
return i;
}
}
break;
case 13:
for (uint8_t i = 1; i <= 10; i++) {
if (i > 8
? uart_received_bytes[6] & (1 << (i - 9))
: uart_received_bytes[7] & (1 << (i - 1))) {
return i;
}
}
break;
}
return uart_received_bytes[5];
default:
@@ -152,8 +180,10 @@ namespace esphome {
int TxUltimateEasy::get_touch_state(const std::array<int, UART_RECEIVED_BYTES_SIZE> &uart_received_bytes) {
int state = uart_received_bytes[4];
if (state == TOUCH_STATE_PRESS && uart_received_bytes[5] != 0) state = TOUCH_STATE_RELEASE;
if (state == TOUCH_STATE_RELEASE && uart_received_bytes[5] == TOUCH_STATE_MULTI_TOUCH) state = TOUCH_STATE_MULTI_TOUCH;
if (state == TOUCH_STATE_PRESS && uart_received_bytes[5] != 0)
state = TOUCH_STATE_RELEASE;
if (state == TOUCH_STATE_RELEASE && uart_received_bytes[5] == TOUCH_STATE_MULTI_TOUCH)
state = TOUCH_STATE_MULTI_TOUCH;
if (state == TOUCH_STATE_SWIPE) {
state = (uart_received_bytes[5] == TOUCH_STATE_SWIPE_RIGHT) ? TOUCH_STATE_SWIPE_RIGHT :
(uart_received_bytes[5] == TOUCH_STATE_SWIPE_LEFT) ? TOUCH_STATE_SWIPE_LEFT : state;

View File

@@ -1 +1 @@
2025.8.1
2025.8.2

View File

@@ -1 +1 @@
version: 2025.8.1
version: 2025.8.2