Skip to content

Commit 77424a7

Browse files
authored
Merge pull request #1417 from UI-Lovelace-Minimalist/release
Release
2 parents 1327816 + e8c6c3f commit 77424a7

File tree

2 files changed

+29
-34
lines changed

2 files changed

+29
-34
lines changed

custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_vertical_button.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ card_vertical_button:
8080
return "vacuum.toggle";
8181
if( entity.entity_id.startsWith("script.") )
8282
return "script.toggle";
83+
if( entity.entity_id.startsWith("button.") )
84+
return "button.press";
8385
// If we need to support other entities we can add these options here.
8486
return "";
8587
]]]

custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_welcome_scenes.yaml

+27-34
Original file line numberDiff line numberDiff line change
@@ -283,28 +283,24 @@ card_scenes_pill_welcome:
283283
[[[
284284
if(variables?.nav_path){
285285
return "navigate"
286-
} else {
287-
return "call-service"
288286
}
287+
return "call-service"
289288
]]]
290289
service: >
291290
[[[
292-
if(typeof(entity) !== 'undefined' && entity !== undefined){
293-
if(entity.entity_id.startsWith("scene.")){
294-
return "scene.turn_on"
295-
}
296-
if(entity.entity_id.startsWith("media_player.")){
297-
return "media_player.media_play_pause"
298-
}
299-
if(entity.entity_id.startsWith("input_select.")){
300-
return "input_select.select_option"
301-
}
302-
if(entity.entity_id.startsWith("script.")){
303-
return entity.entity_id
304-
}
305-
} else {
306-
return "homeassistant.toggle"
291+
if(entity?.entity_id.startsWith("scene.")){
292+
return "scene.turn_on"
293+
}
294+
if(entity?.entity_id.startsWith("media_player.")){
295+
return "media_player.media_play_pause"
307296
}
297+
if(entity?.entity_id.startsWith("input_select.")){
298+
return "input_select.select_option"
299+
}
300+
if(entity?.entity_id.startsWith("script.")){
301+
return entity.entity_id
302+
}
303+
return "homeassistant.toggle"
308304
]]]
309305
navigation_path: "[[[ return variables?.nav_path; ]]]"
310306
service_data: |
@@ -374,29 +370,26 @@ card_scenes_pill_welcome:
374370
[[[
375371
if(variables?.nav_path){
376372
return "navigate"
377-
} else {
378-
return "call-service"
379373
}
374+
return "call-service"
380375
]]]
381376
navigation_path: "[[[ return variables?.nav_path; ]]]"
382377
service: >
383378
[[[
384-
if(typeof(entity) !== 'undefined' && entity !== undefined){
385-
if(entity.entity_id.startsWith("scene.")){
386-
return "scene.turn_on"
387-
}
388-
if(entity.entity_id.startsWith("media_player.")){
389-
return "media_player.media_play_pause"
390-
}
391-
if(entity.entity_id.startsWith("input_select.")){
392-
return "input_select.select_option"
393-
}
394-
if(entity.entity_id.startsWith("script.")){
395-
return entity.entity_id
396-
}
397-
} else {
398-
return "homeassistant.toggle"
379+
if(entity?.entity_id.startsWith("scene.")){
380+
return "scene.turn_on"
381+
}
382+
if(entity?.entity_id.startsWith("media_player.")){
383+
return "media_player.media_play_pause"
399384
}
385+
if(entity?.entity_id.startsWith("input_select.")){
386+
return "input_select.select_option"
387+
}
388+
if(entity?.entity_id.startsWith("script.")){
389+
return entity.entity_id
390+
}
391+
return "homeassistant.toggle"
392+
]]]
400393
service_data: |
401394
[[[
402395
if (variables.service_data){

0 commit comments

Comments
 (0)