1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 08:15:49 +00:00
This commit is contained in:
J. Nick Koston
2025-11-06 16:00:37 -06:00
parent 38cf003bf3
commit 541e0cfde8

View File

@@ -840,8 +840,7 @@ void WiFiComponent::retry_connect() {
this->trying_loaded_ap_ = false;
this->selected_sta_index_ = 0; // Retry from the first configured AP
this->reset_for_next_ap_attempt_();
} else if (this->selected_sta_index_ >= static_cast<int>(this->sta_.size()) - 1) {
// Cast size to int (not int8_t which overflows at 127, not size_t which wraps negative indices)
} else if (this->selected_sta_index_ >= static_cast<int8_t>(this->sta_.size()) - 1) {
// Exhausted all configured APs, restart adapter and cycle back to first
// Restart clears any stuck WiFi driver state
// Each AP is tried with config data only (SSID + optional BSSID/channel if user configured them)