From 6687c5c6a50f27b6af169df2ccd41b31377cef75 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 1 Aug 2025 09:01:37 +0200 Subject: [PATCH] Fix other references to `gang_count_plural_suffix` --- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml | 5 +++-- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml | 5 +++-- ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml | 9 +++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml index e5c914d..8ae40fb 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml @@ -209,10 +209,11 @@ script: - id: !extend dump_config then: - lambda: |- + std:string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; // Button's actions ESP_LOGCONFIG("core_hw_buttons", "Button%s action%s:", - id(gang_count_plural_suffix).c_str(), - id(gang_count_plural_suffix).c_str()); + gang_count_plural_suffix.c_str(), + gang_count_plural_suffix.c_str()); ESP_LOGCONFIG("core_hw_buttons", " Relay 1: %s", sl_button_1_action->has_state() ? sl_button_1_action->state.c_str() : "Unknown"); diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml index e23d649..68fd204 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml @@ -448,10 +448,11 @@ script: - id: !extend dump_config then: - lambda: |- + std:string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; // Relay's LEDs modes ESP_LOGCONFIG("core_hw_leds", "Relay%s LEDs mode%s:", - id(gang_count_plural_suffix).c_str(), - id(gang_count_plural_suffix).c_str()); + gang_count_plural_suffix.c_str(), + gang_count_plural_suffix.c_str()); ESP_LOGCONFIG("core_hw_leds", " Relay 1: %s", id(is_us_model) ? sl_relay_1_light_mode_us->state.c_str() : sl_relay_1_light_mode_eu->state.c_str()); diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml index bb738ad..fe81789 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml @@ -703,10 +703,11 @@ script: - id: !extend dump_config then: - lambda: |- + std:string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; // Relay's modes ESP_LOGCONFIG("standard_hw_relays", "Relay%s mode%s:", - id(gang_count_plural_suffix).c_str(), - id(gang_count_plural_suffix).c_str()); + gang_count_plural_suffix.c_str(), + gang_count_plural_suffix.c_str()); ESP_LOGCONFIG("standard_hw_relays", " Relay 1: %s", sl_relay_1_mode->has_state() ? sl_relay_1_mode->state.c_str() : "Unknown"); @@ -725,8 +726,8 @@ script: // Relay's states ESP_LOGCONFIG("standard_hw_relays", "Relay%s state%s:", - id(gang_count_plural_suffix).c_str(), - id(gang_count_plural_suffix).c_str()); + gang_count_plural_suffix.c_str(), + gang_count_plural_suffix.c_str()); ESP_LOGCONFIG("standard_hw_relays", " Relay 1: %s", sw_relay_1->state ? "ON" : "OFF"); if (id(gang_count) >= 2) ESP_LOGCONFIG("standard_hw_relays", " Relay 2: %s", sw_relay_2->state ? "ON" : "OFF");