1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +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:
Brian Egge 2021-09-01 02:26:09 -04:00 committed by GitHub
parent 36b37b6db3
commit 889aced3b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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