From f394968bd07fca2bb4e4f3ab57dd2c2157e277de Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Thu, 15 Nov 2018 10:13:21 +0100 Subject: [PATCH] Fix fastled lambda light effect Fixes #232 --- esphomeyaml/components/light/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphomeyaml/components/light/__init__.py b/esphomeyaml/components/light/__init__.py index c74376b2fb..0262e3b9b0 100644 --- a/esphomeyaml/components/light/__init__.py +++ b/esphomeyaml/components/light/__init__.py @@ -24,6 +24,7 @@ LightState = light_ns.class_('LightState', Nameable, Component) MakeLight = Application.struct('MakeLight') LightOutput = light_ns.class_('LightOutput') FastLEDLightOutputComponent = light_ns.class_('FastLEDLightOutputComponent', LightOutput) +FastLEDLightOutputComponentRef = FastLEDLightOutputComponent.operator('ref') # Actions ToggleAction = light_ns.class_('ToggleAction', Action) @@ -249,8 +250,7 @@ def build_effect(full_config): add(effect.set_intensity(config[CONF_INTENSITY])) yield effect elif key == CONF_FASTLED_LAMBDA: - lambda_ = None - args = [(RawExpression('FastLEDLightOutputComponent &'), 'it')] + args = [(FastLEDLightOutputComponentRef, 'it')] for lambda_ in process_lambda(config[CONF_LAMBDA], args): yield None yield FastLEDLambdaLightEffect.new(config[CONF_NAME], lambda_, config[CONF_UPDATE_INTERVAL])