From e8de6627d841a3c0f4756f9483dfa9adc80c280a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 3 Jan 2026 00:44:37 -1000 Subject: [PATCH] document, document, document --- esphome/components/wifi/wifi_component.cpp | 3 ++- esphome/components/wifi/wifi_component.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index 9853d26fd3..2c78bbe4d3 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -1293,7 +1293,8 @@ void WiFiComponent::check_connecting_finished(uint32_t now) { } this->roaming_connect_active_ = false; - // Clear all priority penalties - successful connection forgives past failures + // Clear all priority penalties - the next reconnect will happen when an AP disconnects, + // which means the landscape has likely changed and previous tracked failures are stale this->clear_all_bssid_priorities_(); #ifdef USE_WIFI_FAST_CONNECT diff --git a/esphome/components/wifi/wifi_component.h b/esphome/components/wifi/wifi_component.h index 9b2bcf221f..178e27dfaa 100644 --- a/esphome/components/wifi/wifi_component.h +++ b/esphome/components/wifi/wifi_component.h @@ -501,7 +501,7 @@ class WiFiComponent : public Component { int8_t find_next_hidden_sta_(int8_t start_index); /// Log failed connection and decrease BSSID priority to avoid repeated attempts void log_and_adjust_priority_for_failed_connect_(); - /// Clear all BSSID priority penalties (e.g., after successful connection) + /// Clear all BSSID priority penalties after successful connection (stale after disconnect) void clear_all_bssid_priorities_(); /// Clear BSSID priority tracking if all priorities are at minimum (saves memory) void clear_priorities_if_all_min_();