diff --git a/esphome/core/base_automation.h b/esphome/core/base_automation.h index a31c501060..78838c70c8 100644 --- a/esphome/core/base_automation.h +++ b/esphome/core/base_automation.h @@ -330,9 +330,7 @@ template class WhileAction : public Action { template void WhileLoopContinuation::play(Ts... x) { if (this->parent_->num_running_ > 0 && this->parent_->condition_->check(x...)) { // play again - if (this->parent_->num_running_ > 0) { - this->parent_->then_.play(x...); - } + this->parent_->then_.play(x...); } else { // condition false, play next this->parent_->play_next_(x...);