From bd0b7aa344c64f125465e4133c26051a28209701 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Mon, 20 Apr 2020 19:25:38 +0300 Subject: [PATCH] Fix tap actions --- config/home-lovelace.yaml | 30 ++++++++++++++----- .../button_card_templates/small_button.yaml | 6 ++-- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/config/home-lovelace.yaml b/config/home-lovelace.yaml index 7e1b67b..073f247 100644 --- a/config/home-lovelace.yaml +++ b/config/home-lovelace.yaml @@ -78,6 +78,28 @@ views: - type: custom:button-card template: small entity: media_player.nvidia_shield + tap_action: + action: call-service + service: media_player.toggle + service_data: + entity_id: media_player.nvidia_shield + state: + - value: 'playing' + styles: + card: + - background-color: var(--primary-color) + - color: black + icon: + - color: black + - value: 'standby' + styles: + card: + - background-color: var(--primary-color) + - color: black + icon: + - color: black + + - type: custom:button-card template: small entity: media_player.living_room_tv @@ -221,8 +243,6 @@ views: entity: script.music_play name: Chill icon: mdi:music - tap_action: - action: toggle - type: custom:button-card template: small entity: script.music_play @@ -237,8 +257,6 @@ views: template: small entity: script.tv_fireplace name: Fireplace - tap_action: - action: toggle - type: horizontal-stack cards: @@ -247,15 +265,11 @@ views: entity: script.sonos_join_bedroom name: Sonos from Bedroom icon: mdi:speaker-multiple - tap_action: - action: toggle - type: custom:button-card template: small entity: script.sonos_join_tv icon: mdi:speaker-multiple name: Sonos from TV - tap_action: - action: toggle - type: custom:decluttering-card template: sonos_media_player diff --git a/config/lovelace/button_card_templates/small_button.yaml b/config/lovelace/button_card_templates/small_button.yaml index f33fe12..5b3910d 100644 --- a/config/lovelace/button_card_templates/small_button.yaml +++ b/config/lovelace/button_card_templates/small_button.yaml @@ -2,8 +2,6 @@ small: size: 30px hold_action: action: more-info - double_tap_action: - action: more-info styles: card: - height: 100px @@ -17,11 +15,11 @@ small: - background-color: var(--primary-color) - color: black icon: - - color: black + - color: black - value: 'home' styles: card: - background-color: var(--primary-color) - color: black icon: - - color: black + - color: black