Set min_version to ESPHome 2025.8.0

This commit is contained in:
Edward Firmo
2025-08-08 07:37:52 +02:00
parent d905b69ad2
commit 1df58e162f
4 changed files with 35 additions and 17 deletions

View File

@@ -71,6 +71,7 @@ esphome:
name: ${name}
friendly_name: ${friendly_name}
comment: TX Ultimate Easy
min_version: 2025.8.0-dev
project:
name: "edwardtfn.tx_ultimate_easy"
version: ${version}

View File

@@ -30,7 +30,7 @@ substitutions:
LIGHT_INDIVIDUAL_RESTORE_MODE: RESTORE_DEFAULT_OFF
LIGHT_ATTRS_DEFAULT: '0x64FFFFFF' # brightness=100, RGB=255,255,255
LIGHT_DUAL_ATTRS_DEFAULT: '0x64FFFFFF64FFFFFF' # Both lights: brightness=100, RGB=255,255,255
LIGHT_DUAL_ATTRS_DEFAULT: '0x0064FFFFFF64FFFFFF' # Both lights: brightness=100, RGB=255,255,255
TAG_CORE_HW_LEDS: core.hw.leds
@@ -562,6 +562,14 @@ script:
attr_global_ptr: uint32_t*
then:
- lambda: |-
if (!light_ptr) {
ESP_LOGE("${TAG_CORE_HW_LEDS}", "Invalid light pointer");
return;
}
if (!attr_global_ptr) {
ESP_LOGE("${TAG_CORE_HW_LEDS}", "Invalid attributes pointer");
return;
}
auto current = light_ptr->current_values;
tx_ultimate_easy::LightAttributes attrs = {
.brightness = uint8_t(current.get_brightness() * 100.0f),
@@ -582,6 +590,14 @@ script:
group_index: uint8_t # 1 or 2 (which group within the dual pack)
then:
- lambda: |-
if (!light_ptr) {
ESP_LOGE("${TAG_CORE_HW_LEDS}", "Invalid light pointer");
return;
}
if (!attr_global_ptr) {
ESP_LOGE("${TAG_CORE_HW_LEDS}", "Invalid attributes pointer");
return;
}
auto current = light_ptr->current_values;
tx_ultimate_easy::LightAttributes new_attrs = {
.brightness = uint8_t(current.get_brightness() * 100.0f),

View File

@@ -16,7 +16,12 @@ substitutions:
RELAY_MODE_TEXT_LIGHT: "Light"
RELAY_MODE_TEXT_NOT_USED: "Not in use"
LIGHT_RELAYS_RESTORE_MODE: ALWAYS_OFF
# You shouldn't change the restore mode as there is a custom restoring engine based on globals.
# The reason of a custom engine is to address an issue where NVS space was exceeded causing saving/restoring issues
RELAYS_LIGHT_RESTORE_MODE: ALWAYS_OFF
RELAYS_LIGHT_PARTITION_RESTORE_MODE: ALWAYS_OFF
RELAYS_EXPOSE_LEDS_TO_HA_RESTORE_MODE: ALWAYS_OFF
RELAYS_SWITCH_RESTORE_MODE: ALWAYS_OFF
TAG_STD_HW_RELAYS: std.hw.relays
@@ -25,11 +30,6 @@ esphome:
build_flags:
- -D TX_ULTIMATE_EASY_STANDARD_HW_RELAYS
external_components:
- source: github://pr#10105 # To-do: remove after this PR is released
components: [switch]
refresh: 1h
globals:
- &global_attr_dual_light
id: attr_light_rl_1_1_both # 1-gang: relay 1, both groups
@@ -113,7 +113,7 @@ light:
output: output_relay_1
platform: binary
internal: true
restore_mode: ${LIGHT_RELAYS_RESTORE_MODE}
restore_mode: ${RELAYS_LIGHT_RESTORE_MODE}
on_turn_on:
then:
- if:
@@ -194,7 +194,7 @@ light:
internal: true
disabled_by_default: false
default_transition_length: ${default_transition_length}
restore_mode: ALWAYS_OFF
restore_mode: ${RELAYS_LIGHT_PARTITION_RESTORE_MODE}
segments:
- id: light_full
from: 9
@@ -1522,7 +1522,7 @@ switch:
- id: sw_expose_relays_leds_to_ha
name: Expose Relay's LEDs to Home Assistant
platform: template
restore_mode: ALWAYS_OFF
restore_mode: ${RELAYS_EXPOSE_LEDS_TO_HA_RESTORE_MODE}
optimistic: true
internal: false
entity_category: config
@@ -1545,7 +1545,7 @@ switch:
name: Relay 1
output: output_relay_1
platform: output
restore_mode: ALWAYS_OFF
restore_mode: ${RELAYS_SWITCH_RESTORE_MODE}
internal: true
on_turn_on:
then:
@@ -1571,7 +1571,7 @@ switch:
name: Relay 2
output: output_relay_2
platform: output
restore_mode: ALWAYS_OFF
restore_mode: ${RELAYS_SWITCH_RESTORE_MODE}
internal: true
on_turn_on:
then:
@@ -1597,7 +1597,7 @@ switch:
name: Relay 3
output: output_relay_3
platform: output
restore_mode: ALWAYS_OFF
restore_mode: ${RELAYS_SWITCH_RESTORE_MODE}
internal: true
on_turn_on:
then:
@@ -1623,7 +1623,7 @@ switch:
name: Relay 4
output: output_relay_4
platform: output
restore_mode: ALWAYS_OFF
restore_mode: ${RELAYS_SWITCH_RESTORE_MODE}
internal: true
on_turn_on:
then:

View File

@@ -74,8 +74,9 @@ namespace esphome {
if (this->gang_count_ == 1)
return 1;
// 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
// Calculate button width (rounds up to ensure full coverage)
const uint8_t width =
(TOUCH_MAX_POSITION + this->gang_count_) / this->gang_count_; // Width of each button region
if (width < 1) // Invalid width - and prevents division by zero
return 0;
const uint8_t button = std::min(