Fixx yeelight flow action param for declared effects (#22159)

This commit is contained in:
zewelor 2019-03-18 20:51:42 +01:00 committed by Teemu R
parent af473cddf0
commit 9591aa66ba

View File

@ -161,14 +161,20 @@ def _cmd(func):
def _parse_custom_effects(effects_config):
import yeelight
effects = {}
for config in effects_config:
params = config[CONF_FLOW_PARAMS]
action = yeelight.Flow.actions[params[ATTR_ACTION]]
transitions = YeelightLight.transitions_config_parser(
params[ATTR_TRANSITIONS])
effects[config[CONF_NAME]] = \
{ATTR_COUNT: params[ATTR_COUNT], ATTR_TRANSITIONS: transitions}
effects[config[CONF_NAME]] = {
ATTR_COUNT: params[ATTR_COUNT],
ATTR_ACTION: action,
ATTR_TRANSITIONS: transitions
}
return effects