mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 23:57:06 +00:00
Simplify MQTT light brightness logic (#35097)
This commit is contained in:
parent
90fbb150e7
commit
e7fc886992
@ -428,9 +428,7 @@ class MqttLightJson(
|
|||||||
if self._brightness is not None:
|
if self._brightness is not None:
|
||||||
brightness = 255
|
brightness = 255
|
||||||
else:
|
else:
|
||||||
brightness = kwargs.get(
|
brightness = kwargs.get(ATTR_BRIGHTNESS, 255)
|
||||||
ATTR_BRIGHTNESS, self._brightness if self._brightness else 255
|
|
||||||
)
|
|
||||||
rgb = color_util.color_hsv_to_RGB(
|
rgb = color_util.color_hsv_to_RGB(
|
||||||
hs_color[0], hs_color[1], brightness / 255 * 100
|
hs_color[0], hs_color[1], brightness / 255 * 100
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user