added light toggle to buttonpress

This commit is contained in:
joBr99
2022-03-20 10:57:44 +01:00
committed by GitHub
parent 34e1ed26c1
commit d0beef2386

View File

@@ -218,6 +218,8 @@ class NsPanelLovelaceUI:
if(btype == "button"):
if(entity_id.startswith('scene')):
self.api.get_entity(entity_id).call_service("turn_on")
if(entity_id.startswith('light') or entity_id.startswith('switch')):
self.api.get_entity(entity_id).call_service("toggle")
else:
self.api.get_entity(entity_id).call_service("press")