Move "Relay n light mode" to standard_hw_relays
This commit is contained in:
@@ -494,27 +494,6 @@ script:
|
||||
- id: !extend dump_config
|
||||
then:
|
||||
- lambda: |-
|
||||
std::string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : "";
|
||||
// Relay's LEDs modes
|
||||
ESP_LOGCONFIG("${TAG_CORE_HW_LEDS}", "Relay%s LEDs mode%s:",
|
||||
gang_count_plural_suffix.c_str(),
|
||||
gang_count_plural_suffix.c_str());
|
||||
ESP_LOGCONFIG("${TAG_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());
|
||||
if (id(gang_count) >= 2)
|
||||
ESP_LOGCONFIG("${TAG_CORE_HW_LEDS}", " Relay 2: %s", id(is_us_model) ?
|
||||
sl_relay_2_light_mode_us->state.c_str() :
|
||||
sl_relay_2_light_mode_eu->state.c_str());
|
||||
if (id(gang_count) >= 3)
|
||||
ESP_LOGCONFIG("${TAG_CORE_HW_LEDS}", " Relay 3: %s", id(is_us_model) ?
|
||||
sl_relay_3_light_mode_us->state.c_str() :
|
||||
sl_relay_3_light_mode_eu->state.c_str());
|
||||
if (id(gang_count) >= 4)
|
||||
ESP_LOGCONFIG("${TAG_CORE_HW_LEDS}", " Relay 4: %s", id(is_us_model) ?
|
||||
sl_relay_4_light_mode_us->state.c_str() :
|
||||
sl_relay_4_light_mode_eu->state.c_str());
|
||||
|
||||
// Transition times
|
||||
ESP_LOGCONFIG("${TAG_CORE_HW_LEDS}", "Transition times:");
|
||||
ESP_LOGCONFIG("${TAG_CORE_HW_LEDS}", " Default: ${default_transition_length}");
|
||||
@@ -621,58 +600,4 @@ script:
|
||||
*attr_global_ptr = tx_ultimate_easy::pack_dual_light_attributes(existing.first, new_attrs);
|
||||
}
|
||||
|
||||
select:
|
||||
# EU relay light mode template
|
||||
- &relay_light_mode_eu
|
||||
id: sl_relay_1_light_mode_eu
|
||||
name: Relay 1 light mode EU
|
||||
platform: template
|
||||
options:
|
||||
- "${LIGHT_MODE_DISABLED_TEXT}"
|
||||
- "${LIGHT_MODE_BOTTOM_TEXT}"
|
||||
- "${LIGHT_MODE_TOP_TEXT}"
|
||||
- "${LIGHT_MODE_BOTH_TEXT}"
|
||||
initial_option: "${LIGHT_MODE_BOTTOM_TEXT}"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
internal: true
|
||||
entity_category: config
|
||||
disabled_by_default: false
|
||||
icon: mdi:dots-square
|
||||
- id: sl_relay_2_light_mode_eu
|
||||
name: Relay 2 light mode EU
|
||||
<<: *relay_light_mode_eu
|
||||
- id: sl_relay_3_light_mode_eu
|
||||
name: Relay 3 light mode EU
|
||||
<<: *relay_light_mode_eu
|
||||
- id: sl_relay_4_light_mode_eu
|
||||
name: Relay 4 light mode EU
|
||||
<<: *relay_light_mode_eu
|
||||
|
||||
# US relay light mode template
|
||||
- &relay_light_mode_us
|
||||
id: sl_relay_1_light_mode_us
|
||||
name: Relay 1 light mode US
|
||||
platform: template
|
||||
options:
|
||||
- "${LIGHT_MODE_DISABLED_TEXT}"
|
||||
- "${LIGHT_MODE_LEFT_TEXT}"
|
||||
- "${LIGHT_MODE_RIGHT_TEXT}"
|
||||
- "${LIGHT_MODE_BOTH_TEXT}"
|
||||
initial_option: "${LIGHT_MODE_RIGHT_TEXT}"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
internal: true
|
||||
entity_category: config
|
||||
disabled_by_default: false
|
||||
icon: mdi:dots-square
|
||||
- id: sl_relay_2_light_mode_us
|
||||
name: Relay 2 light mode US
|
||||
<<: *relay_light_mode_us
|
||||
- id: sl_relay_3_light_mode_us
|
||||
name: Relay 3 light mode US
|
||||
<<: *relay_light_mode_us
|
||||
- id: sl_relay_4_light_mode_us
|
||||
name: Relay 4 light mode US
|
||||
<<: *relay_light_mode_us
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user