Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
switch color to white mode when change warm
Browse files Browse the repository at this point in the history
  • Loading branch information
bbo76 committed Dec 23, 2021
1 parent bceb408 commit c43e485
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/beewi_light/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self,device):
self._address = device[CONF_ADDRESS]
self._light = BeewiSmartLight(self._address)
self.is_valid = True
self._rgb = None
self._rgbw = None
self._brightness = None
self._isOn = None
self._isWhite = None
Expand Down Expand Up @@ -87,10 +87,10 @@ def turn_on(self, **kwargs):
self._light.setBrightness(brightness)

if not rgbw == None:
if rgbw[0] == 255 and rgbw[1] == 255 and rgbw[2] == 255:
""" Consider that we want the White mode and eventually set the light tone"""
tone = rgbw[3]
tone = rgbw[3]

if (rgbw[0] == 255 and rgbw[1] == 255 and rgbw[2] == 255) or self._rgbw[3] != tone:
""" Consider that we want the White mode and eventually set the light tone"""
if not self._isWhite:
self._light.setWhite()
self._isWhite = True
Expand Down

0 comments on commit c43e485

Please sign in to comment.