Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db83050d7b | ||
|
|
d7dcc05506 | ||
|
|
b6dc915469 | ||
|
|
dcc68f7077 | ||
|
|
23d28a32a3 | ||
|
|
ba8f19060f | ||
|
|
c36af8a220 | ||
|
|
6fad9d7074 |
11
.github/workflows/versioning.yml
vendored
11
.github/workflows/versioning.yml
vendored
@@ -55,9 +55,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Update stable tag
|
- name: Update stable tag
|
||||||
if: |
|
if: |
|
||||||
success() &&
|
success() && (
|
||||||
github.event_name == 'workflow_dispatch' &&
|
github.event_name == 'workflow_dispatch' && inputs.update_stable ||
|
||||||
inputs.update_stable
|
github.event_name == 'push'
|
||||||
|
)
|
||||||
run: |
|
run: |
|
||||||
# Verify version bump was successful
|
# Verify version bump was successful
|
||||||
if [ ! -f "./versioning/VERSION" ]; then
|
if [ ! -f "./versioning/VERSION" ]; then
|
||||||
@@ -74,7 +75,7 @@ jobs:
|
|||||||
# Update tag
|
# Update tag
|
||||||
NEW_VERSION=$(cat ./versioning/VERSION)
|
NEW_VERSION=$(cat ./versioning/VERSION)
|
||||||
echo "Updating stable tag to $NEW_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
|
git push origin stable --force
|
||||||
|
|
||||||
- name: Update latest tag
|
- name: Update latest tag
|
||||||
@@ -99,6 +100,6 @@ jobs:
|
|||||||
# Update tag
|
# Update tag
|
||||||
NEW_VERSION=$(cat ./versioning/VERSION)
|
NEW_VERSION=$(cat ./versioning/VERSION)
|
||||||
echo "Updating latest tag to $NEW_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
|
git push origin latest --force
|
||||||
...
|
...
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ Follow these steps to get your TX Ultimate device up and running with ESPHome.
|
|||||||
packages:
|
packages:
|
||||||
remote_package:
|
remote_package:
|
||||||
url: https://github.com/edwardtfn/TX-Ultimate-Easy
|
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
|
refresh: 5min
|
||||||
files:
|
files:
|
||||||
- ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml # Core (essential) packages
|
- ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml # Core (essential) packages
|
||||||
@@ -225,7 +225,7 @@ Here's an example of the advanced configuration:
|
|||||||
packages:
|
packages:
|
||||||
remote_package:
|
remote_package:
|
||||||
url: https://github.com/edwardtfn/TX-Ultimate-Easy
|
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
|
refresh: 5min
|
||||||
files:
|
files:
|
||||||
# Core (essential) packages
|
# Core (essential) packages
|
||||||
|
|||||||
@@ -69,9 +69,9 @@ namespace esphome {
|
|||||||
if (this->gang_count_ == 1)
|
if (this->gang_count_ == 1)
|
||||||
return 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
|
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;
|
return 0;
|
||||||
const uint8_t button = std::min(
|
const uint8_t button = std::min(
|
||||||
static_cast<uint8_t>((position / width) + 1), // Convert position to button index
|
static_cast<uint8_t>((position / width) + 1), // Convert position to button index
|
||||||
@@ -141,8 +141,36 @@ namespace esphome {
|
|||||||
switch (uart_received_bytes[4]) {
|
switch (uart_received_bytes[4]) {
|
||||||
case TOUCH_STATE_RELEASE:
|
case TOUCH_STATE_RELEASE:
|
||||||
case TOUCH_STATE_MULTI_TOUCH:
|
case TOUCH_STATE_MULTI_TOUCH:
|
||||||
|
return uart_received_bytes[5];
|
||||||
|
|
||||||
case TOUCH_STATE_SWIPE_LEFT:
|
case TOUCH_STATE_SWIPE_LEFT:
|
||||||
case TOUCH_STATE_SWIPE_RIGHT:
|
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];
|
return uart_received_bytes[5];
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -152,8 +180,10 @@ namespace esphome {
|
|||||||
|
|
||||||
int TxUltimateEasy::get_touch_state(const std::array<int, UART_RECEIVED_BYTES_SIZE> &uart_received_bytes) {
|
int TxUltimateEasy::get_touch_state(const std::array<int, UART_RECEIVED_BYTES_SIZE> &uart_received_bytes) {
|
||||||
int state = uart_received_bytes[4];
|
int state = uart_received_bytes[4];
|
||||||
if (state == TOUCH_STATE_PRESS && uart_received_bytes[5] != 0) state = TOUCH_STATE_RELEASE;
|
if (state == TOUCH_STATE_PRESS && uart_received_bytes[5] != 0)
|
||||||
if (state == TOUCH_STATE_RELEASE && uart_received_bytes[5] == TOUCH_STATE_MULTI_TOUCH) state = TOUCH_STATE_MULTI_TOUCH;
|
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) {
|
if (state == TOUCH_STATE_SWIPE) {
|
||||||
state = (uart_received_bytes[5] == TOUCH_STATE_SWIPE_RIGHT) ? TOUCH_STATE_SWIPE_RIGHT :
|
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;
|
(uart_received_bytes[5] == TOUCH_STATE_SWIPE_LEFT) ? TOUCH_STATE_SWIPE_LEFT : state;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2025.8.1
|
2025.8.2
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
version: 2025.8.1
|
version: 2025.8.2
|
||||||
|
|||||||
Reference in New Issue
Block a user