Fix parsing yeelight custom effects, when not present in config (#20658)
This commit is contained in:
1 parent
25e1639050
commit
7429b9d87e
1 file changed
+7
-1
@@ -193,8 +193,14 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||||||
name = device_config[CONF_NAME]
|
name = device_config[CONF_NAME]
|
||||||
_LOGGER.debug("Adding configured %s", name)
|
_LOGGER.debug("Adding configured %s", name)
|
||||||
|
|
||||||
custom_effects = _parse_custom_effects(config[CONF_CUSTOM_EFFECTS])
|
|
||||||
device = {'name': name, 'ipaddr': ipaddr}
|
device = {'name': name, 'ipaddr': ipaddr}
|
||||||
|
|
||||||
|
if CONF_CUSTOM_EFFECTS in config:
|
||||||
|
custom_effects = \
|
||||||
|
_parse_custom_effects(config[CONF_CUSTOM_EFFECTS])
|
||||||
|
else:
|
||||||
|
custom_effects = None
|
||||||
|
|
||||||
light = YeelightLight(device, device_config,
|
light = YeelightLight(device, device_config,
|
||||||
custom_effects=custom_effects)
|
custom_effects=custom_effects)
|
||||||
lights.append(light)
|
lights.append(light)
|
||||||
|
|||||||
Reference in new issue
Block a user