Danielhiversen / flux_led

A utility for controlling Flux WiFi Smart LED Light Bulbs
GNU Lesser General Public License v3.0
157 stars 144 forks source link

CONF_CUSTOM_EFFECT_COLORS not defaulted to [] #134

Closed brianegge closed 2 years ago

brianegge commented 2 years ago

On startup:

2021-10-18 07:16:06 ERROR (MainThread) [homeassistant.components.light] Error while setting up flux_led platform for light
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/home/homeassistant/.homeassistant/custom_components/flux_led/light.py", line 272, in async_setup_entry
    list(custom_effect_colors),
TypeError: 'NoneType' object is not iterable

It would appear the CONF_CUSTOM_EFFECT_COLORS can return empty, and then the literal_eval returns None:

custom_effect_colors = ast.literal_eval(
            options.get(CONF_CUSTOM_EFFECT_COLORS) or "[]"
        )
brianegge commented 2 years ago

https://github.com/home-assistant/core/pull/57979