From 1798a8da6515c62cd712959f7be295720afb384e Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sun, 10 Oct 2021 20:21:21 +0300 Subject: [PATCH] UI Improvements --- .../cards/philips_airpurifier_card.yaml | 43 +++++++++++++++---- .../cards/purfier_target_humidity_card.yaml | 22 ---------- .../hallway_dashboard/at_home_dashboard.yaml | 2 +- .../coming_home_dashboard.yaml | 2 +- .../leaving_home_dashboard.yaml | 2 +- config/lovelace/popup_cards.yaml | 14 ++++-- 6 files changed, 48 insertions(+), 37 deletions(-) delete mode 100644 config/lovelace/decluttering_templates/cards/purfier_target_humidity_card.yaml diff --git a/config/lovelace/decluttering_templates/cards/philips_airpurifier_card.yaml b/config/lovelace/decluttering_templates/cards/philips_airpurifier_card.yaml index c7d4f55..234309e 100644 --- a/config/lovelace/decluttering_templates/cards/philips_airpurifier_card.yaml +++ b/config/lovelace/decluttering_templates/cards/philips_airpurifier_card.yaml @@ -5,10 +5,13 @@ philips_airpurifier_card: - type: horizontal-stack cards: - type: custom:button-card - template: default + template: [v3_button_purifier, v3_popup_button] entity: fan.philips_airpurifier + styles: + card: + - margin-left: 8px - type: custom:button-card - template: default + template: [v3_button, v3_popup_button] entity: sensor.purifier_speed tap_action: action: call-service @@ -16,21 +19,45 @@ philips_airpurifier_card: service_data: entity_id: input_select.purifier_speed - type: custom:button-card - template: default + template: [v3_button, v3_popup_button] entity: sensor.purifier_preset_mode + state_display: "[[[ return entity.state.charAt(0).toUpperCase() + entity.state.slice(1); ]]]" tap_action: action: call-service service: input_select.select_next service_data: entity_id: input_select.purifier_preset_mode + - type: horizontal-stack + cards: - type: custom:button-card - template: default + template: [v3_button, v3_popup_button] entity: sensor.purifier_function tap_action: action: call-service service: script.purifier_toggle_function - - type: custom:decluttering-card - template: purifier_target_humidity + styles: + card: + - margin-left: 8px + + - type: custom:button-card + template: [v3_button, v3_popup_button] + entity: sensor.purifier_target_humidity + variables: + value_has_error: | + [[[ + return states['binary_sensor.purifier_out_of_water'].state === 'on'; + ]]] + tap_action: + action: call-service + service: input_select.select_next + service_data: + entity_id: input_select.purifier_target_humidity + + - type: custom:button-card + template: [v3_button, v3_popup_button] + entity: binary_sensor.purifier_filter_needs_change + variables: + value_has_error: "[[[ return entity.state === 'on' ]]]" - type: entities show_header_toggle: false @@ -40,7 +67,6 @@ philips_airpurifier_card: type: custom:template-entity-row name: Sensors icon: mdi:air-purifier - open: true entities: - sensor.purifier_air_quality - sensor.purifier_allergens @@ -51,7 +77,7 @@ philips_airpurifier_card: head: type: custom:template-entity-row name: Attributes - open: true + icon: mdi:view-headline entities: - sensor.purifier_speed - sensor.purifier_preset_mode @@ -66,6 +92,7 @@ philips_airpurifier_card: head: type: custom:template-entity-row name: Filters + icon: mdi:air-filter entities: - sensor.purifier_pre_filter - sensor.purifier_hepa_filter diff --git a/config/lovelace/decluttering_templates/cards/purfier_target_humidity_card.yaml b/config/lovelace/decluttering_templates/cards/purfier_target_humidity_card.yaml deleted file mode 100644 index b24fd77..0000000 --- a/config/lovelace/decluttering_templates/cards/purfier_target_humidity_card.yaml +++ /dev/null @@ -1,22 +0,0 @@ -purifier_target_humidity: - card: - type: custom:button-card - template: [regular, progress, with_state_indicator] - entity: sensor.purifier_target_humidity - tap_action: - action: call-service - service: input_select.select_next - service_data: - entity_id: input_select.purifier_target_humidity - show_state: true - show_icon: false - variables: - min_value: 30 - max_value: 60 - normal_value: 61 - high_value: 61 - state_indicator_id: binary_sensor.purifier_out_of_water - state_indicator_size: 5px - state_indicator_off_size: 0px - state_indicator_on_color: var(--color-red) - state_on_indicator_on_color: var(--color-red) diff --git a/config/lovelace/hallway_dashboard/at_home_dashboard.yaml b/config/lovelace/hallway_dashboard/at_home_dashboard.yaml index e5a6288..a3dcacb 100644 --- a/config/lovelace/hallway_dashboard/at_home_dashboard.yaml +++ b/config/lovelace/hallway_dashboard/at_home_dashboard.yaml @@ -130,7 +130,7 @@ card: - type: custom:button-card template: [v3_button_cover, v3_tablet_button] entity: cover.living_room - name: LR Cover + name: LR Blinds tap_action: action: call-service service: script.toggle_living_room_cover diff --git a/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml b/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml index aa92d6a..2b1be3b 100644 --- a/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml +++ b/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml @@ -143,7 +143,7 @@ card: - type: custom:button-card template: [v3_button_cover, v3_tablet_button] entity: cover.living_room - name: LR Cover + name: LR Blinds tap_action: action: call-service service: script.toggle_living_room_cover diff --git a/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml b/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml index 77b6c87..1068efe 100644 --- a/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml +++ b/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml @@ -97,7 +97,7 @@ card: - type: custom:button-card template: [v3_button_cover, v3_tablet_button] entity: cover.living_room - name: LR Cover + name: LR Blinds tap_action: action: call-service service: script.toggle_living_room_cover diff --git a/config/lovelace/popup_cards.yaml b/config/lovelace/popup_cards.yaml index 567788b..e0558cf 100644 --- a/config/lovelace/popup_cards.yaml +++ b/config/lovelace/popup_cards.yaml @@ -102,20 +102,25 @@ media_player.nvidia_shield: &nvidia_shield - type: horizontal-stack cards: - type: custom:button-card + template: [v3_button, v3_popup_button] icon: mdi:set-top-box name: Set to Shield - template: default + show_state: false tap_action: action: call-service service: media_player.select_source service_data: entity_id: media_player.living_room_tv source: Shield + styles: + card: + - margin-left: 8px - type: custom:button-card + template: [v3_button, v3_popup_button] name: Set to Switch icon: mdi:video-input-hdmi - template: default + show_state: false tap_action: action: call-service service: media_player.select_source @@ -124,9 +129,10 @@ media_player.nvidia_shield: &nvidia_shield source: Switch - type: custom:button-card + template: [v3_button, v3_popup_button] name: Bulsatcom icon: mdi:remote-tv - template: default + show_state: false tap_action: action: call-service service: script.tv_bulsatcom_toggle @@ -354,7 +360,7 @@ sensor.purifier_allergens: template: bedroom_allergen_index_card fan.philips_airpurifier: - title: Air purifier + title: Air Purifier card: type: custom:decluttering-card template: philips_airpurifier_card