From 9937ad7fa03cbf999ed82976cb9c5b921f749f9f Mon Sep 17 00:00:00 2001 From: Alex <33379584+alexyao2015@users.noreply.github.com> Date: Wed, 1 Sep 2021 18:56:40 -0500 Subject: [PATCH] Cleanup flash transitions (#2227) --- esphome/components/light/transformers.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/esphome/components/light/transformers.h b/esphome/components/light/transformers.h index adcaebe0c8..d501d53f72 100644 --- a/esphome/components/light/transformers.h +++ b/esphome/components/light/transformers.h @@ -86,12 +86,10 @@ class LightFlashTransformer : public LightTransformer { } } - if (millis() > this->start_time_ + this->length_ - this->transition_length_ && - !this->secondary_transition_occurred_) { + if (millis() > this->start_time_ + this->length_ - this->transition_length_) { // second transition back to start value this->transformer_ = this->state_.get_output()->create_default_transition(); this->transformer_->setup(this->state_.current_values, this->get_start_values(), this->transition_length_); - this->secondary_transition_occurred_ = true; } // once transition is complete, don't change states until next transition @@ -108,7 +106,6 @@ class LightFlashTransformer : public LightTransformer { protected: LightState &state_; uint32_t transition_length_; - bool secondary_transition_occurred_{false}; std::unique_ptr transformer_{nullptr}; };