Fix Hue grouped light color_mode calculation ()

pull/63388/head
Marcel van der Veldt 2022-01-04 17:15:19 +01:00 committed by GitHub
parent c423b01eb0
commit 829ff9c423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions
homeassistant/components/hue/v2

View File

@ -298,7 +298,10 @@ class GroupedHueLight(HueBaseEntity, LightEntity):
supported_color_modes.add(COLOR_MODE_ONOFF)
self._attr_supported_color_modes = supported_color_modes
# pick a winner for the current colormode
if lights_in_colortemp_mode == lights_with_color_temp_support:
if (
lights_with_color_temp_support > 0
and lights_in_colortemp_mode == lights_with_color_temp_support
):
self._attr_color_mode = COLOR_MODE_COLOR_TEMP
elif lights_with_color_support > 0:
self._attr_color_mode = COLOR_MODE_XY