Skip to content

Commit

Permalink
Fix light update failing. (#136)
Browse files Browse the repository at this point in the history
* Fix light update failing on color_RGB_to_hs.
  • Loading branch information
vlebourl authored Jul 9, 2020
1 parent 2f98835 commit e3d58a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/tahoma/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,14 @@ def update(self):
states = self.tahoma_device.active_states

self._state = states.get(CORE_ON_OFF_STATE) == STATE_ON

self._brightness = states.get(CORE_LIGHT_INTENSITY_STATE)

self._hs_color = color_util.color_RGB_to_hs(
[r, g, b] = [
states.get(CORE_RED_COLOR_INTENSITY_STATE),
states.get(CORE_GREEN_COLOR_INTENSITY_STATE),
states.get(CORE_BLUE_COLOR_INTENSITY_STATE),
]
self._hs_color = (
None if None in [r, g, b] else color_util.color_RGB_to_hs(r, g, b)
)

0 comments on commit e3d58a9

Please sign in to comment.