From cb2e486f6e4696beec1499a51213bcba89ad33c0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 10 Feb 2022 18:12:36 -0600 Subject: [PATCH] Guard against 0 value for color temp in WiZ when turning off (#66295) --- homeassistant/components/wiz/light.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/wiz/light.py b/homeassistant/components/wiz/light.py index d0473c4f5c3..ef60deea956 100644 --- a/homeassistant/components/wiz/light.py +++ b/homeassistant/components/wiz/light.py @@ -108,9 +108,8 @@ class WizBulbEntity(WizToggleEntity, LightEntity): assert color_modes is not None if (brightness := state.get_brightness()) is not None: self._attr_brightness = max(0, min(255, brightness)) - if ( - COLOR_MODE_COLOR_TEMP in color_modes - and (color_temp := state.get_colortemp()) is not None + if COLOR_MODE_COLOR_TEMP in color_modes and ( + color_temp := state.get_colortemp() ): self._attr_color_mode = COLOR_MODE_COLOR_TEMP self._attr_color_temp = color_temperature_kelvin_to_mired(color_temp)