diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml index 2f5b1ef..7b3e76e 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml @@ -133,11 +133,34 @@ script: - id: buttons_release mode: restart then: - - lambda: |- - if (bs_button_1->state) bs_button_1->publish_state(false); - if (bs_button_2->state) bs_button_2->publish_state(false); - if (bs_button_3->state) bs_button_3->publish_state(false); - if (bs_button_4->state) bs_button_4->publish_state(false); + - if: + condition: + binary_sensor.is_on: bs_button_1 + then: + - binary_sensor.template.publish: + id: bs_button_1 + state: OFF # yamllint disable-line rule:truthy + - if: + condition: + binary_sensor.is_on: bs_button_2 + then: + - binary_sensor.template.publish: + id: bs_button_2 + state: OFF # yamllint disable-line rule:truthy + - if: + condition: + binary_sensor.is_on: bs_button_3 + then: + - binary_sensor.template.publish: + id: bs_button_3 + state: OFF # yamllint disable-line rule:truthy + - if: + condition: + binary_sensor.is_on: bs_button_4 + then: + - binary_sensor.template.publish: + id: bs_button_4 + state: OFF # yamllint disable-line rule:truthy - id: !extend touch_on_multi_touch_release then: @@ -193,7 +216,8 @@ script: - script.execute: buttons_release select: - - id: sl_button_1_action + - &button_select_action_base + id: sl_button_1_action name: Button 1 action platform: template options: @@ -212,12 +236,7 @@ select: options: - "None" - "Relay 2 (toggle)" - optimistic: true - restore_value: true - internal: true - entity_category: config - disabled_by_default: false - icon: mdi:dip-switch + <<: *button_select_action_base - id: sl_button_3_action name: Button 3 action @@ -225,12 +244,7 @@ select: options: - "None" - "Relay 3 (toggle)" - optimistic: true - restore_value: true - internal: true - entity_category: config - disabled_by_default: false - icon: mdi:dip-switch + <<: *button_select_action_base - id: sl_button_4_action name: Button 4 action @@ -238,10 +252,5 @@ select: options: - "None" - "Relay 4 (toggle)" - optimistic: true - restore_value: true - internal: true - entity_category: config - disabled_by_default: false - icon: mdi:dip-switch + <<: *button_select_action_base ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml index 4f67524..04cd406 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml @@ -126,7 +126,7 @@ script: } select: - - &relay_mode_base + - &relay_select_mode_base id: sl_relay_1_mode name: Relay 1 mode platform: template @@ -143,15 +143,15 @@ select: - id: sl_relay_2_mode name: Relay 2 mode - <<: *relay_mode_base + <<: *relay_select_mode_base - id: sl_relay_3_mode name: Relay 3 mode - <<: *relay_mode_base + <<: *relay_select_mode_base - id: sl_relay_4_mode name: Relay 4 mode - <<: *relay_mode_base + <<: *relay_select_mode_base switch: - &relay_switch_base diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml index ec73074..dc5dcc4 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml @@ -123,7 +123,7 @@ script: then: - binary_sensor.template.publish: id: bs_swipe_left - state: ON + state: ON # yamllint disable-line rule:truthy - delay: !lambda return nr_touch_duration->state; - script.execute: touch_swipe_turn_off_binary_sensor @@ -139,7 +139,7 @@ script: then: - binary_sensor.template.publish: id: bs_swipe_right - state: ON + state: ON # yamllint disable-line rule:truthy - delay: !lambda return nr_touch_duration->state; - script.execute: touch_swipe_turn_off_binary_sensor @@ -152,14 +152,14 @@ script: then: - binary_sensor.template.publish: id: bs_swipe_left - state: OFF + state: OFF # yamllint disable-line rule:truthy - if: condition: binary_sensor.is_on: bs_swipe_right then: - binary_sensor.template.publish: id: bs_swipe_right - state: OFF + state: OFF # yamllint disable-line rule:truthy switch: - id: sw_touch_panel_power diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml index 366d77f..2d1689c 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml @@ -49,7 +49,7 @@ script: - id: !extend touch_on_multi_touch_release then: - script.execute: touch_on_multi_touch_release_vibration - + - id: touch_on_multi_touch_release_vibration mode: restart then: @@ -60,7 +60,7 @@ script: - id: !extend touch_on_press then: - script.execute: touch_on_press_vibration - + - id: touch_on_press_vibration mode: restart then: @@ -71,7 +71,7 @@ script: - id: !extend touch_on_release then: - script.execute: touch_on_release_vibration - + - id: touch_on_release_vibration mode: restart then: