mirror of
https://github.com/esphome/esphome.git
synced 2026-03-24 15:06:08 +08:00
874b30d97d932df8985cf4daaec691c6d77baffd
When WiFi disconnects while a roaming scan is in progress, the SCANNING state was transitioning to IDLE in retry_connect(). When the device then reconnected, check_connecting_finished() treated the IDLE state as a normal connection and reset roaming_attempts_ to 0. This caused the roaming counter to perpetually restart at 1/3 instead of progressing to 2/3, 3/3, creating an infinite loop of roaming scans every 5 minutes. This is most likely to occur on ESP8266 where disconnect callbacks run immediately in SDK system context (setting error_from_callback_ before the main loop can process scan results), compared to ESP32 IDF where events are queued and the scan-done event is typically processed before the disconnect. Fix by transitioning to RECONNECTING instead of IDLE when a disconnect occurs during SCANNING. This preserves the attempts counter on successful reconnection, allowing the device to reach the 3-attempt limit and stop scanning.
…
…
…
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
588 MiB
Languages
C++
63.4%
Python
36.2%
C
0.3%
