display light detail in correct mode

This commit is contained in:
joBr99
2022-03-16 17:37:21 +01:00
parent 12f44a5198
commit ab314e3401
3 changed files with 2 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -510,7 +510,7 @@ class NsPanelLovelaceUI:
# scale ha color temp range to 0-100 # scale ha color temp range to 0-100
color_temp = int(self.scale(entity.attributes.color_temp,(entity.attributes.min_mireds, entity.attributes.max_mireds),(0,100))) color_temp = int(self.scale(entity.attributes.color_temp,(entity.attributes.min_mireds, entity.attributes.max_mireds),(0,100)))
else: else:
color_temp = 0 color_temp = "unknown"
else: else:
color_temp = "disable" color_temp = "disable"
@@ -530,7 +530,7 @@ class NsPanelLovelaceUI:
hsv = colorsys.hsv_to_rgb(h,s,v) hsv = colorsys.hsv_to_rgb(h,s,v)
return tuple(round(i * 255) for i in hsv) return tuple(round(i * 255) for i in hsv)
def pos_to_color(self, x, y): def pos_to_color(self, x, y):
r = 213/2 r = 160/2
x = round((x - r) / r * 100) / 100 x = round((x - r) / r * 100) / 100
y = round((r - y) / r * 100) / 100 y = round((r - y) / r * 100) / 100