From 570843150d8c4aaf0ece7bcf25817f4bb5865333 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 1 Jun 2019 21:59:59 +0200 Subject: [PATCH] Fix flicker light effect turning itself off (#594) Fixes https://github.com/esphome/issues/issues/382 --- esphome/components/light/base_light_effects.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/light/base_light_effects.h b/esphome/components/light/base_light_effects.h index 4b33b77073..55aa007f56 100644 --- a/esphome/components/light/base_light_effects.h +++ b/esphome/components/light/base_light_effects.h @@ -129,7 +129,7 @@ class FlickerLightEffect : public LightEffect { LightColorValues out; const float alpha = this->alpha_; const float beta = 1.0f - alpha; - out.set_state(remote.get_state()); + out.set_state(true); out.set_brightness(remote.get_brightness() * beta + current.get_brightness() * alpha + (random_cubic_float() * this->intensity_)); out.set_red(remote.get_red() * beta + current.get_red() * alpha + (random_cubic_float() * this->intensity_)); @@ -144,6 +144,7 @@ class FlickerLightEffect : public LightEffect { if (traits.get_supports_brightness()) call.set_transition_length(0); call.from_light_color_values(out); + call.set_state(true); call.perform(); }