From 78a0fecc0865baa6b23d9ab7588bee8fc6456399 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 15 Jul 2025 11:03:56 -1000 Subject: [PATCH] Fix timing overflow when components disable themselves during loop --- esphome/core/application.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index d6fab018cc..d74fbe5dd0 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -309,6 +309,9 @@ void Application::disable_component_loop_(Component *component) { if (this->in_loop_ && i == this->current_loop_index_) { // Decrement so we'll process the swapped component next this->current_loop_index_--; + // Update the loop start time to current time so the swapped component + // gets correct timing instead of inheriting stale timing + this->loop_component_start_time_ = millis(); } } return;