1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-15 06:15:47 +00:00

[core] Avoid redundant millis() calls in base_automation loop methods

This commit is contained in:
J. Nick Koston
2025-11-02 18:52:59 -06:00
parent 19e275dc02
commit c10663d88c

View File

@@ -103,7 +103,7 @@ template<typename... Ts> class ForCondition : public Condition<Ts...>, public Co
bool check_internal() { bool check_internal() {
bool cond = this->condition_->check(); bool cond = this->condition_->check();
if (!cond) if (!cond)
this->last_inactive_ = millis(); this->last_inactive_ = App.get_loop_component_start_time();
return cond; return cond;
} }
@@ -380,7 +380,7 @@ template<typename... Ts> class WaitUntilAction : public Action<Ts...>, public Co
if (this->num_running_ == 0) if (this->num_running_ == 0)
return; return;
auto now = millis(); auto now = App.get_loop_component_start_time();
this->var_queue_.remove_if([&](auto &queued) { this->var_queue_.remove_if([&](auto &queued) {
auto start = std::get<uint32_t>(queued); auto start = std::get<uint32_t>(queued);