From 0f80c16507904c9f3caa0abb7818dbe958e13f85 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 11 Apr 2026 00:03:55 -1000 Subject: [PATCH] [status_led] Skip feed_wdt dispatch entirely when idle --- esphome/core/application.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index 1766f35dd65..03091a4141c 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -207,13 +207,16 @@ void HOT Application::feed_wdt(uint32_t time) { #ifdef USE_STATUS_LED if (status_led::global_status_led != nullptr) { auto *sl = status_led::global_status_led; - // If an error or warning bit is set while status_led's loop is disabled, re-enable it - // so it starts blinking again. disable_loop() is called from loop() itself when idle. - if ((sl->get_component_state() & COMPONENT_STATE_MASK) == COMPONENT_STATE_LOOP_DONE && - (this->app_state_ & STATUS_LED_MASK) != 0) { - sl->enable_loop(); + if ((sl->get_component_state() & COMPONENT_STATE_MASK) == COMPONENT_STATE_LOOP_DONE) { + // Loop was disabled by status_led itself when it went idle. Only re-enable (and + // dispatch) if an error or warning bit has been set since; otherwise skip entirely. + if ((this->app_state_ & STATUS_LED_MASK) != 0) { + sl->enable_loop(); + sl->call(); + } + } else { + sl->call(); } - sl->call(); } #endif }