From bb4cc4d4ab4f94e21379afab7eb507a328ca3254 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sat, 2 May 2020 20:19:37 +0300 Subject: [PATCH] use input_select.select_next --- .../home_dashboard/main_dashboard.yaml | 8 ++++++-- config/packages/modes/house_mode.yaml | 20 ++----------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/config/lovelace/home_dashboard/main_dashboard.yaml b/config/lovelace/home_dashboard/main_dashboard.yaml index d025c54..83af326 100644 --- a/config/lovelace/home_dashboard/main_dashboard.yaml +++ b/config/lovelace/home_dashboard/main_dashboard.yaml @@ -159,12 +159,16 @@ - type: custom:button-card template: default entity: binary_sensor.house_mode + tap_action: + action: call-service + service: input_select.select_next + service_data: + entity_id: input_select.house_mode - type: custom:button-card template: default entity: input_boolean.guest_mode tap_action: - action: call-service - service: script.house_mode_next + action: toggle - type: horizontal-stack title: Climate diff --git a/config/packages/modes/house_mode.yaml b/config/packages/modes/house_mode.yaml index 98a5780..26fd0dd 100644 --- a/config/packages/modes/house_mode.yaml +++ b/config/packages/modes/house_mode.yaml @@ -25,23 +25,6 @@ binary_sensor: {% endif %} -script: - house_mode_next: - alias: House mode · Next - sequence: - - service: input_select.select_option - entity_id: input_select.house_mode - data_template: - option: > - - {% if is_state('input_select.house_mode', 'day') %} - bed - {% elif is_state('input_select.house_mode', 'bed') %} - night - {% else %} - day - {% endif %} - automation: - alias: House mode · Set to day trigger: @@ -75,5 +58,6 @@ automation: device_ieee: !secret master_bedroom_bedside_switch_ieee command: double action: - - service: script.house_mode_next + - service: input_select.select_next + entity_id: input_select.house_mode