Skip to content

Commit

Permalink
display light detail in correct mode
Browse files Browse the repository at this point in the history
  • Loading branch information
joBr99 committed Mar 16, 2022
1 parent 864f5b8 commit 4d27f2f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file modified HMI/nspanel.HMI
Binary file not shown.
Binary file modified HMI/nspanel.tft
Binary file not shown.
4 changes: 2 additions & 2 deletions apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def generate_detail_page(self, page_type, entity):
# 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)))
else:
color_temp = 0
color_temp = "unknown"
else:
color_temp = "disable"

Expand All @@ -530,7 +530,7 @@ def hsv2rgb(self, h, s, v):
hsv = colorsys.hsv_to_rgb(h,s,v)
return tuple(round(i * 255) for i in hsv)
def pos_to_color(self, x, y):
r = 213/2
r = 160/2
x = round((x - r) / r * 100) / 100
y = round((r - y) / r * 100) / 100

Expand Down

0 comments on commit 4d27f2f

Please sign in to comment.