From 1768c2b447cbf1a1e37b0bdec6a4bb995dbdc6b0 Mon Sep 17 00:00:00 2001 From: sjabby Date: Mon, 18 Feb 2019 22:05:46 +0100 Subject: [PATCH] Fix for #19072 (#21175) * Fix for #19072 PR #19072 introduced the custom_effect feature but it didnt make it optional as the documentation states. This causes error on startup and the component does not work. ``` Error while setting up platform flux_led Traceback (most recent call last): File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for return fut.result() File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result raise self._exception File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/flux_led.py", line 135, in setup_platform device[CONF_CUSTOM_EFFECT] = device_config[CONF_CUSTOM_EFFECT] KeyError: 'custom_effect' ``` Changing this line to make the custom_effect optional as the original intention. * Update flux_led.py --- homeassistant/components/light/flux_led.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/light/flux_led.py b/homeassistant/components/light/flux_led.py index 088fc871fc1..5ecf3f55e10 100644 --- a/homeassistant/components/light/flux_led.py +++ b/homeassistant/components/light/flux_led.py @@ -132,7 +132,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): device['ipaddr'] = ipaddr device[CONF_PROTOCOL] = device_config.get(CONF_PROTOCOL) device[ATTR_MODE] = device_config[ATTR_MODE] - device[CONF_CUSTOM_EFFECT] = device_config[CONF_CUSTOM_EFFECT] + device[CONF_CUSTOM_EFFECT] = device_config.get(CONF_CUSTOM_EFFECT) light = FluxLight(device) lights.append(light) light_ips.append(ipaddr)