From 0b9b33b81b55447ae21bf761c6ee4b8f3e5bb4a9 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 22 Jul 2025 15:42:09 -1000 Subject: [PATCH] [core] Initialize looping_components_ before setup blocking phase --- esphome/core/application.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index 873f342277..b48f12a4cb 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -55,6 +55,9 @@ void Application::setup() { return a->get_actual_setup_priority() > b->get_actual_setup_priority(); }); + // Initialize looping_components_ early so enable_pending_loops_() works during setup + this->calculate_looping_components_(); + for (uint32_t i = 0; i < this->components_.size(); i++) { Component *component = this->components_[i]; @@ -97,7 +100,6 @@ void Application::setup() { clear_setup_priority_overrides(); this->schedule_dump_config(); - this->calculate_looping_components_(); } void Application::loop() { uint8_t new_app_state = 0;