From d0beef2386d0359a35e5770a63ef901090648a41 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sun, 20 Mar 2022 10:57:44 +0100 Subject: [PATCH] added light toggle to buttonpress --- apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py index cadb1455..735a0f7d 100644 --- a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py +++ b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py @@ -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")