mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-21 23:14:25 +01:00
added light color to detail page
This commit is contained in:
@@ -519,6 +519,18 @@ class NsPanelLovelaceUI:
|
|||||||
if(page_type == "popupLight"):
|
if(page_type == "popupLight"):
|
||||||
entity = self.api.get_entity(entity)
|
entity = self.api.get_entity(entity)
|
||||||
switch_val = 1 if entity.state == "on" else 0
|
switch_val = 1 if entity.state == "on" else 0
|
||||||
|
|
||||||
|
icon_color = 17299
|
||||||
|
|
||||||
|
if "rgb_color" in entity.attributes:
|
||||||
|
color = entity.attributes.rgb_color
|
||||||
|
if "brightness" in entity.attributes:
|
||||||
|
color = rgb_brightness(color, entity.attributes.brightness)
|
||||||
|
icon_color = rgb_dec565(color)
|
||||||
|
elif "brightness" in entity.attributes:
|
||||||
|
color = rgb_brightness(color, [253, 216, 53])
|
||||||
|
icon_color = rgb_dec565(color)
|
||||||
|
|
||||||
brightness = "disable"
|
brightness = "disable"
|
||||||
color_temp = "disable"
|
color_temp = "disable"
|
||||||
color = "disable"
|
color = "disable"
|
||||||
@@ -541,7 +553,7 @@ class NsPanelLovelaceUI:
|
|||||||
color = "enable"
|
color = "enable"
|
||||||
else:
|
else:
|
||||||
color = "disable"
|
color = "disable"
|
||||||
self.send_mqtt_msg(f"entityUpdateDetail,{switch_val},{brightness},{color_temp},{color}")
|
self.send_mqtt_msg(f"entityUpdateDetail,1,{icon_color},{switch_val},{brightness},{color_temp},{color}")
|
||||||
|
|
||||||
if(page_type == "popupShutter"):
|
if(page_type == "popupShutter"):
|
||||||
pos = self.api.get_entity(msg[3]).attributes.current_position
|
pos = self.api.get_entity(msg[3]).attributes.current_position
|
||||||
|
|||||||
Reference in New Issue
Block a user