Compare commits

..

3 Commits

Author SHA1 Message Date
Johannes
341cc5d9c7 fix shutter detail page 2022-03-13 01:06:42 +01:00
Johannes Braun
72f9af1175 fix bug on light page #2 2022-03-12 19:49:58 +01:00
Johannes Braun
c93ad3ce13 bugfix on light detail page 2022-03-12 19:33:21 +01:00
5 changed files with 48 additions and 42 deletions

View File

@@ -165,7 +165,7 @@ Text tVersion
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 2
Text : 4
Max. Text Size : 10
Picture p0

View File

@@ -68,7 +68,7 @@ Variable (int32) mode
Attributes
ID : 23
Scope: local
Value: 0
Value: 1
Variable (int32) mode_bright
Attributes
@@ -384,9 +384,10 @@ Button bColor
Events
Touch Press Event
if(mode.val==0)
if(mode.val==1)
{
mode.val=1
mode.val=0
//enable color wheel
vis pColorWheel,1
vis t0,1
//disable brightness
@@ -399,7 +400,8 @@ Button bColor
vis hTempSlider,0
}else
{
mode.val=0
mode.val=1
//disable color wheel
vis pColorWheel,0
vis t0,0
if(mode_bright.val==1)
@@ -529,39 +531,42 @@ Timer tmSerial
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
// get Brightness value
spstr strCommand.txt,tTmp.txt,",",2
if(tTmp.txt=="disable")
if(mode.val==1)
{
vis t1,0
vis t2,0
vis hBrightness,0
mode_bright.val=0
}else
{
vis t1,1
vis t2,1
vis hBrightness,1
mode_bright.val=1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,",",3
if(tTmp.txt=="disable")
{
vis t4,0
vis t3,0
vis hTempSlider,0
mode_temp.val=0
}else
{
vis t4,1
vis t3,1
vis hTempSlider,1
mode_temp.val=1
covx tTmp.txt,sys0,0,0
hTempSlider.val=sys0
// get Brightness value
spstr strCommand.txt,tTmp.txt,",",2
if(tTmp.txt=="disable")
{
vis t1,0
vis t2,0
vis hBrightness,0
mode_bright.val=0
}else
{
vis t1,1
vis t2,1
vis hBrightness,1
mode_bright.val=1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,",",3
if(tTmp.txt=="disable")
{
vis t4,0
vis t3,0
vis hTempSlider,0
mode_temp.val=0
}else
{
vis t4,1
vis t3,1
vis hTempSlider,1
mode_temp.val=1
covx tTmp.txt,sys0,0,0
hTempSlider.val=sys0
}
}
// get ColorWheel value
spstr strCommand.txt,tTmp.txt,",",4

Binary file not shown.

Binary file not shown.

View File

@@ -455,17 +455,18 @@ class NsPanelLovelanceUI:
color_temp = 0
else:
color_temp = "disable"
if "xy" in entity.attributes.supported_color_modes:
color = "enable"
else:
color = "disable"
self.send_mqtt_msg(f"entityUpdateDetail,{switch_val},{brightness},{color_temp},{color}")
if(page_type == "popupShutter"):
pos = self.api.get_entity(msg[3]).attributes.current_position
# reverse position for slider
pos = 100-pos
self.send_mqtt_msg("entityUpdateDetail,{0}".format(pos))
if(page_type == "popupShutter"):
pos = self.api.get_entity(msg[3]).attributes.current_position
# reverse position for slider
pos = 100-pos
self.send_mqtt_msg("entityUpdateDetail,{0}".format(pos))
def hsv2rgb(self, h, s, v):
hsv = colorsys.hsv_to_rgb(h,s,v)