From c863a204e8514aecef9ceb5da8db686c6be650f8 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 11 Apr 2026 23:36:40 -1000 Subject: [PATCH] [esp8266] Fix incorrect claim about delay() usage scope delay() is called from component loop() and update() methods too (NFC, RTTTL, sensors), not just setup/OTA. --- esphome/components/esp8266/core.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/esp8266/core.cpp b/esphome/components/esp8266/core.cpp index c26cddea7e..ab991da9f4 100644 --- a/esphome/components/esp8266/core.cpp +++ b/esphome/components/esp8266/core.cpp @@ -81,8 +81,8 @@ uint64_t millis_64() { return Millis64Impl::compute(millis()); } // os_timer and calls esp_suspend() to suspend the continuation once for the // full duration. Our loop polls millis() + optimistic_yield(1000) which still // calls esp_schedule()/esp_suspend_within_cont() via yield(), so SDK tasks -// and WiFi run correctly. Less power-efficient for long delays, but ESPHome -// uses delay() only during setup and OTA — never on the hot path. +// and WiFi run correctly. Less power-efficient for long delays but +// functionally equivalent. void HOT delay(uint32_t ms) { if (ms == 0) { optimistic_yield(1000);