From 13722eccd07c07e2cf9caeb84dced45027cb589f Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 19 Dec 2024 20:30:55 +0100 Subject: [PATCH] Reorg relays --- ...TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml | 24 +++++++------- ...-Ultimate-Easy-ESPHome_core_hw_relays.yaml | 33 +++---------------- 2 files changed, 17 insertions(+), 40 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml index 951ae5f..555b5ca 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml @@ -767,17 +767,17 @@ select: disabled_by_default: false icon: mdi:dots-square - - <<: *relay_light_mode_eu - id: sl_relay_2_light_mode_eu + - id: sl_relay_2_light_mode_eu name: Relay 2 light mode + <<: *relay_light_mode_eu - - <<: *relay_light_mode_eu - id: sl_relay_3_light_mode_eu + - id: sl_relay_3_light_mode_eu name: Relay 3 light mode + <<: *relay_light_mode_eu - - <<: *relay_light_mode_eu - id: sl_relay_4_light_mode_eu + - id: sl_relay_4_light_mode_eu name: Relay 4 light mode + <<: *relay_light_mode_eu # US relay light mode template - &relay_light_mode_us @@ -797,15 +797,15 @@ select: disabled_by_default: false icon: mdi:dots-square - - <<: *relay_light_mode_us - id: sl_relay_2_light_mode_us + - id: sl_relay_2_light_mode_us name: Relay 2 light mode + <<: *relay_light_mode_us - - <<: *relay_light_mode_us - id: sl_relay_3_light_mode_us + - id: sl_relay_3_light_mode_us name: Relay 3 light mode + <<: *relay_light_mode_us - - <<: *relay_light_mode_us - id: sl_relay_4_light_mode_us + - id: sl_relay_4_light_mode_us name: Relay 4 light mode + <<: *relay_light_mode_us ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml index 04008e9..eeaf855 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml @@ -172,7 +172,8 @@ select: icon: mdi:dip-switch switch: - - id: sw_relay_1 + - &relay_switch_base + id: sw_relay_1 name: Relay 1 platform: output output: output_relay_1 @@ -187,40 +188,16 @@ switch: - id: sw_relay_2 name: Relay 2 - platform: output output: output_relay_2 - restore_mode: RESTORE_DEFAULT_OFF - internal: true - on_turn_on: - then: - - script.execute: show_relay_status - on_turn_off: - then: - - script.execute: show_relay_status + <<: *relay_switch_base - id: sw_relay_3 name: Relay 3 - platform: output output: output_relay_3 - restore_mode: RESTORE_DEFAULT_OFF - internal: true - on_turn_on: - then: - - script.execute: show_relay_status - on_turn_off: - then: - - script.execute: show_relay_status + <<: *relay_switch_base - id: sw_relay_4 name: Relay 4 - platform: output output: output_relay_4 - restore_mode: RESTORE_DEFAULT_OFF - internal: true - on_turn_on: - then: - - script.execute: show_relay_status - on_turn_off: - then: - - script.execute: show_relay_status + <<: *relay_switch_base ...