Fix parsing yeelight custom effects, when not present in config (#20658)

This commit is contained in:
zewelor authored and Paulus Schoutsen committed 2019-02-01 14:10:38 -08:00
1 parent 1a5028f56f
commit 47660f9312
1 file changed
+7 -1
+7 -1
View File
@@ -193,8 +193,14 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
name = device_config[CONF_NAME]
_LOGGER.debug("Adding configured %s", name)
custom_effects = _parse_custom_effects(config[CONF_CUSTOM_EFFECTS])
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,
custom_effects=custom_effects)
lights.append(light)