From 889aced3b632330e801703b0f6f6c926d7c10c9d Mon Sep 17 00:00:00 2001 From: Brian Egge Date: Wed, 1 Sep 2021 02:26:09 -0400 Subject: [PATCH] Fix None support_color_modes TypeError (#55497) * Fix None support_color_modes TypeError https://github.com/home-assistant/core/issues/55451 * Update __init__.py --- homeassistant/components/light/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index 6865ae165bc..4a0025126c8 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -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