mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
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
@ -91,7 +91,8 @@ class SenseHatLight(Light):
|
|||||||
|
|
||||||
def turn_on(self, **kwargs):
|
def turn_on(self, **kwargs):
|
||||||
"""Instruct the light to turn on and set correct brightness & color."""
|
"""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)
|
percent_bright = (self._brightness / 255)
|
||||||
|
|
||||||
if ATTR_RGB_COLOR in kwargs:
|
if ATTR_RGB_COLOR in kwargs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user