Simplify MQTT light brightness logic (#35097)

This commit is contained in:
Michael Bisbjerg 2020-05-03 18:48:24 +02:00 committed by GitHub
parent 90fbb150e7
commit e7fc886992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -428,9 +428,7 @@ class MqttLightJson(
if self._brightness is not None:
brightness = 255
else:
brightness = kwargs.get(
ATTR_BRIGHTNESS, self._brightness if self._brightness else 255
)
brightness = kwargs.get(ATTR_BRIGHTNESS, 255)
rgb = color_util.color_hsv_to_RGB(
hs_color[0], hs_color[1], brightness / 255 * 100
)