mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-21 21:54:46 +01:00
added light toggle to buttonpress
This commit is contained in:
@@ -218,6 +218,8 @@ class NsPanelLovelaceUI:
|
|||||||
if(btype == "button"):
|
if(btype == "button"):
|
||||||
if(entity_id.startswith('scene')):
|
if(entity_id.startswith('scene')):
|
||||||
self.api.get_entity(entity_id).call_service("turn_on")
|
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:
|
else:
|
||||||
self.api.get_entity(entity_id).call_service("press")
|
self.api.get_entity(entity_id).call_service("press")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user