From 0881ff2d1fe4034b33821775fa236589d8836912 Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Fri, 26 Aug 2022 10:00:46 -0400 Subject: [PATCH] Add guard to enhanced current hue usage in ZHA (#77359) --- homeassistant/components/zha/light.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/zha/light.py b/homeassistant/components/zha/light.py index 88bd5299ff7..5a8011e2386 100644 --- a/homeassistant/components/zha/light.py +++ b/homeassistant/components/zha/light.py @@ -605,7 +605,10 @@ class Light(BaseLight, ZhaEntity): and not self._zha_config_always_prefer_xy_color_mode ): self._attr_supported_color_modes.add(ColorMode.HS) - if self._color_channel.enhanced_hue_supported: + if ( + self._color_channel.enhanced_hue_supported + and self._color_channel.enhanced_current_hue is not None + ): curr_hue = self._color_channel.enhanced_current_hue * 65535 / 360 else: curr_hue = self._color_channel.current_hue * 254 / 360