mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Add guard to enhanced current hue usage in ZHA (#77359)
This commit is contained in:
parent
36d77d1f33
commit
0881ff2d1f
@ -605,7 +605,10 @@ class Light(BaseLight, ZhaEntity):
|
|||||||
and not self._zha_config_always_prefer_xy_color_mode
|
and not self._zha_config_always_prefer_xy_color_mode
|
||||||
):
|
):
|
||||||
self._attr_supported_color_modes.add(ColorMode.HS)
|
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
|
curr_hue = self._color_channel.enhanced_current_hue * 65535 / 360
|
||||||
else:
|
else:
|
||||||
curr_hue = self._color_channel.current_hue * 254 / 360
|
curr_hue = self._color_channel.current_hue * 254 / 360
|
||||||
|
Loading…
x
Reference in New Issue
Block a user