Skip to content

Commit

Permalink
Merge pull request #1415 from basbruss/bug
Browse files Browse the repository at this point in the history
Fix button service in scenes card
  • Loading branch information
basbruss committed Nov 24, 2023
2 parents ef1e707 + 297efb0 commit 6b46290
Showing 1 changed file with 27 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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){
Expand Down

0 comments on commit 6b46290

Please sign in to comment.