From 05d42d4467d16391a247dffbfc05f12dc03f56a7 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 29 Oct 2022 22:17:10 +0200 Subject: [PATCH] upd: remove unnecessary choose --- blueprint.yaml | 77 +++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 45 deletions(-) diff --git a/blueprint.yaml b/blueprint.yaml index 4b40db9..7bba0fc 100644 --- a/blueprint.yaml +++ b/blueprint.yaml @@ -1578,7 +1578,38 @@ action: data: component: "{{ component_to_update }}bri" message: "{{ btn_bri_txt }}" - + - conditions: + - condition: trigger + id: left_button_press + sequence: + - service: >- + {% if left_button_entity is match 'light.' %} + light.toggle + {% elif left_button_entity is match 'switch.' %} + switch.toggle + {% elif left_button_entity is match 'cover.' %} + cover.toggle + {% elif left_button_entity is match 'input_boolean.' %} + input_boolean.toggle + {% endif %} + data: + entity_id: "{{ left_button_entity }}" + - conditions: + - condition: trigger + id: right_button_press + sequence: + - service: >- + {% if right_button_entity is match 'light.' %} + light.toggle + {% elif right_button_entity is match 'switch.' %} + switch.toggle + {% elif right_button_entity is match 'cover.' %} + cover.toggle + {% elif right_button_entity is match 'input_boolean.' %} + input_boolean.toggle + {% endif %} + data: + entity_id: "{{ right_button_entity }}" ##### NSPanel Loading##### - choose: @@ -2493,50 +2524,6 @@ action: component: thermostat.a07 message: "{{states(accuweather_realfeel_temperature_max_0d) | round(0)}}°" - ##### Left Button - Toggle ##### - - choose: - - conditions: - - condition: trigger - id: left_button_press - sequence: - - service: >- - {% if left_button_entity is match 'light.' %} - light.toggle - {% elif left_button_entity is match 'switch.' %} - switch.toggle - {% elif left_button_entity is match 'cover.' %} - cover.toggle - {% elif left_button_entity is match 'input_boolean.' %} - input_boolean.toggle - {% endif %} - data: - entity_id: "{{ left_button_entity }}" - - ##### Right Button - Toggle ##### - - choose: - - conditions: - - condition: trigger - id: right_button_press - sequence: - - service: >- - {% if right_button_entity is match 'light.' %} - light.toggle - {% elif right_button_entity is match 'switch.' %} - switch.toggle - {% elif right_button_entity is match 'cover.' %} - cover.toggle - {% elif right_button_entity is match 'input_boolean.' %} - input_boolean.toggle - {% endif %} - data: - entity_id: "{{ right_button_entity }}" - - - - - - - ######################################### #