From 1fa359967e818c37725734612f84886ece63ed39 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Fri, 30 Apr 2021 18:51:16 +0300 Subject: [PATCH] Change cover icon in buttons --- config/lovelace/button_card_templates/devices/cover.yaml | 6 ++++++ config/lovelace/hallway_dashboard/at_home_dashboard.yaml | 2 +- .../lovelace/hallway_dashboard/coming_home_dashboard.yaml | 2 +- .../lovelace/hallway_dashboard/leaving_home_dashboard.yaml | 2 +- config/lovelace/home_dashboard/living_room_dashboard.yaml | 2 +- config/lovelace/home_dashboard/main_dashboard.yaml | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 config/lovelace/button_card_templates/devices/cover.yaml diff --git a/config/lovelace/button_card_templates/devices/cover.yaml b/config/lovelace/button_card_templates/devices/cover.yaml new file mode 100644 index 0000000..11da713 --- /dev/null +++ b/config/lovelace/button_card_templates/devices/cover.yaml @@ -0,0 +1,6 @@ +cover: + template: default + icon: > + [[[ + return entity.state === "open" ? "mdi:window-shutter-open" : "mdi:window-shutter"; + ]]] diff --git a/config/lovelace/hallway_dashboard/at_home_dashboard.yaml b/config/lovelace/hallway_dashboard/at_home_dashboard.yaml index 9e94308..e0c7428 100644 --- a/config/lovelace/hallway_dashboard/at_home_dashboard.yaml +++ b/config/lovelace/hallway_dashboard/at_home_dashboard.yaml @@ -156,7 +156,7 @@ cards: name: "Kitchen" - type: custom:button-card - template: [small, with_state_background] + template: [small, with_state_background, cover] entity: cover.living_room name: LR Cover tap_action: diff --git a/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml b/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml index b7d54a2..835c967 100644 --- a/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml +++ b/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml @@ -151,7 +151,7 @@ cards: entity: climate.kitchen_radiator_mode name: "Kitchen" - type: custom:button-card - template: [small, with_state_background] + template: [small, with_state_background, cover] entity: cover.living_room name: LR Cover tap_action: diff --git a/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml b/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml index 2c1a92d..5baabca 100644 --- a/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml +++ b/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml @@ -18,7 +18,7 @@ cards: columns: 4 cards: - type: custom:button-card - template: [small, with_state_background] + template: [small, with_state_background, cover] entity: cover.living_room name: LR Cover tap_action: diff --git a/config/lovelace/home_dashboard/living_room_dashboard.yaml b/config/lovelace/home_dashboard/living_room_dashboard.yaml index 273ff25..f26e0ce 100644 --- a/config/lovelace/home_dashboard/living_room_dashboard.yaml +++ b/config/lovelace/home_dashboard/living_room_dashboard.yaml @@ -137,7 +137,7 @@ - type: horizontal-stack cards: - type: custom:button-card - template: default + template: [default, cover] entity: cover.living_room name: Cover tap_action: diff --git a/config/lovelace/home_dashboard/main_dashboard.yaml b/config/lovelace/home_dashboard/main_dashboard.yaml index 0691b99..bf48723 100644 --- a/config/lovelace/home_dashboard/main_dashboard.yaml +++ b/config/lovelace/home_dashboard/main_dashboard.yaml @@ -225,7 +225,7 @@ - type: horizontal-stack cards: - type: custom:button-card - template: default + template: [default, cover] entity: cover.living_room name: LR Cover tap_action: