Skip to content

Commit

Permalink
Unset color when going to white mode
Browse files Browse the repository at this point in the history
  • Loading branch information
postlund committed Oct 21, 2020
1 parent ae1bd35 commit eb53a83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/localtuya/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(
CONF_BRIGHTNESS_UPPER, DEFAULT_UPPER_BRIGHTNESS
)
self._is_white_mode = True # Hopefully sane default
self._hs = [0, 0]
self._hs = None

@property
def is_on(self):
Expand Down Expand Up @@ -182,6 +182,8 @@ def status_updated(self):

if supported & SUPPORT_COLOR:
self._is_white_mode = self.dps_conf(CONF_COLOR_MODE) == "white"
if self._is_white_mode:
self._hs = None

if self._is_white_mode:
if supported & SUPPORT_BRIGHTNESS:
Expand Down

0 comments on commit eb53a83

Please sign in to comment.