1
0
mirror of https://github.com/esphome/esphome.git synced 2024-10-06 19:00:59 +01:00

Fix fastled lambda light effect

Fixes #232
This commit is contained in:
Otto Winter 2018-11-15 10:13:21 +01:00
parent be21aa786d
commit a169d37557
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E

View File

@ -22,6 +22,7 @@ LightState = light_ns.class_('LightState', Nameable, Component)
MakeLight = Application.struct('MakeLight') MakeLight = Application.struct('MakeLight')
LightOutput = light_ns.class_('LightOutput') LightOutput = light_ns.class_('LightOutput')
FastLEDLightOutputComponent = light_ns.class_('FastLEDLightOutputComponent', LightOutput) FastLEDLightOutputComponent = light_ns.class_('FastLEDLightOutputComponent', LightOutput)
FastLEDLightOutputComponentRef = FastLEDLightOutputComponent.operator('ref')
# Actions # Actions
ToggleAction = light_ns.class_('ToggleAction', Action) ToggleAction = light_ns.class_('ToggleAction', Action)
@ -246,8 +247,7 @@ def build_effect(full_config):
add(effect.set_intensity(config[CONF_INTENSITY])) add(effect.set_intensity(config[CONF_INTENSITY]))
yield effect yield effect
elif key == CONF_FASTLED_LAMBDA: elif key == CONF_FASTLED_LAMBDA:
lambda_ = None args = [(FastLEDLightOutputComponentRef, 'it')]
args = [(RawExpression('FastLEDLightOutputComponent &'), 'it')]
for lambda_ in process_lambda(config[CONF_LAMBDA], args): for lambda_ in process_lambda(config[CONF_LAMBDA], args):
yield None yield None
yield FastLEDLambdaLightEffect.new(config[CONF_NAME], lambda_, config[CONF_UPDATE_INTERVAL]) yield FastLEDLambdaLightEffect.new(config[CONF_NAME], lambda_, config[CONF_UPDATE_INTERVAL])