mirror of
https://github.com/home-assistant/core
synced 2024-09-09 12:51:22 +02:00
Fix None support_color_modes TypeError (#55497)
* Fix None support_color_modes TypeError https://github.com/home-assistant/core/issues/55451 * Update __init__.py
This commit is contained in:
parent
36b37b6db3
commit
889aced3b6
@ -445,7 +445,11 @@ async def async_setup(hass, config): # noqa: C901
|
||||
)
|
||||
|
||||
# If both white and brightness are specified, override white
|
||||
if ATTR_WHITE in params and COLOR_MODE_WHITE in supported_color_modes:
|
||||
if (
|
||||
supported_color_modes
|
||||
and ATTR_WHITE in params
|
||||
and COLOR_MODE_WHITE in supported_color_modes
|
||||
):
|
||||
params[ATTR_WHITE] = params.pop(ATTR_BRIGHTNESS, params[ATTR_WHITE])
|
||||
|
||||
# Remove deprecated white value if the light supports color mode
|
||||
|
Loading…
Reference in New Issue
Block a user