From 8f589d2ea6fa50a1511fcf641168f08f39584081 Mon Sep 17 00:00:00 2001 From: MastrUsr <34539988+MastrUsr@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:56:43 +0100 Subject: [PATCH 1/2] Update card_vertical_button.yaml HA can have buttons, not just input_buttons.. (This is my first time, please be patient with me). --- .../card_templates/cards/card_vertical_button.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_vertical_button.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_vertical_button.yaml index 83d3cac62..1667d8e9d 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_vertical_button.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_vertical_button.yaml @@ -80,6 +80,8 @@ card_vertical_button: return "vacuum.toggle"; if( entity.entity_id.startsWith("script.") ) return "script.toggle"; + if( entity.entity_id.startsWith("button.") ) + return "button.press"; // If we need to support other entities we can add these options here. return ""; ]]] From a063e7b431db3476da8138d8f2d7bb24fce6fd75 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:33:22 +0100 Subject: [PATCH 2/2] Update card_welcome_scenes.yaml Fix bug in service call --- .../cards/card_welcome_scenes.yaml | 61 ++++++++----------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_welcome_scenes.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_welcome_scenes.yaml index 8ad3c6011..8ad6c4697 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_welcome_scenes.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_welcome_scenes.yaml @@ -283,28 +283,24 @@ card_scenes_pill_welcome: [[[ if(variables?.nav_path){ return "navigate" - } else { - return "call-service" } + return "call-service" ]]] service: > [[[ - if(typeof(entity) !== 'undefined' && entity !== undefined){ - if(entity.entity_id.startsWith("scene.")){ - return "scene.turn_on" - } - if(entity.entity_id.startsWith("media_player.")){ - return "media_player.media_play_pause" - } - if(entity.entity_id.startsWith("input_select.")){ - return "input_select.select_option" - } - if(entity.entity_id.startsWith("script.")){ - return entity.entity_id - } - } else { - return "homeassistant.toggle" + if(entity?.entity_id.startsWith("scene.")){ + return "scene.turn_on" + } + if(entity?.entity_id.startsWith("media_player.")){ + return "media_player.media_play_pause" } + if(entity?.entity_id.startsWith("input_select.")){ + return "input_select.select_option" + } + if(entity?.entity_id.startsWith("script.")){ + return entity.entity_id + } + return "homeassistant.toggle" ]]] navigation_path: "[[[ return variables?.nav_path; ]]]" service_data: | @@ -374,29 +370,26 @@ card_scenes_pill_welcome: [[[ if(variables?.nav_path){ return "navigate" - } else { - return "call-service" } + return "call-service" ]]] navigation_path: "[[[ return variables?.nav_path; ]]]" service: > [[[ - if(typeof(entity) !== 'undefined' && entity !== undefined){ - if(entity.entity_id.startsWith("scene.")){ - return "scene.turn_on" - } - if(entity.entity_id.startsWith("media_player.")){ - return "media_player.media_play_pause" - } - if(entity.entity_id.startsWith("input_select.")){ - return "input_select.select_option" - } - if(entity.entity_id.startsWith("script.")){ - return entity.entity_id - } - } else { - return "homeassistant.toggle" + if(entity?.entity_id.startsWith("scene.")){ + return "scene.turn_on" + } + if(entity?.entity_id.startsWith("media_player.")){ + return "media_player.media_play_pause" } + if(entity?.entity_id.startsWith("input_select.")){ + return "input_select.select_option" + } + if(entity?.entity_id.startsWith("script.")){ + return entity.entity_id + } + return "homeassistant.toggle" + ]]] service_data: | [[[ if (variables.service_data){