light.sensehat: brightness control logic update (#7409)
Do not reset brightness when brightness is not explicitly supplied. Based on conversation at: https://github.com/home-assistant/home-assistant/pull/7377#discussion_r114102005
This commit is contained in:
parent
1aa3ab52b7
commit
8654993b18
1 changed files with 2 additions and 1 deletions
|
@ -91,7 +91,8 @@ class SenseHatLight(Light):
|
|||
|
||||
def turn_on(self, **kwargs):
|
||||
"""Instruct the light to turn on and set correct brightness & color."""
|
||||
self._brightness = kwargs.get(ATTR_BRIGHTNESS, 255)
|
||||
if ATTR_BRIGHTNESS in kwargs:
|
||||
self._brightness = kwargs[ATTR_BRIGHTNESS]
|
||||
percent_bright = (self._brightness / 255)
|
||||
|
||||
if ATTR_RGB_COLOR in kwargs:
|
||||
|
|
Loading…
Add table
Reference in a new issue