From 8eb509f8f0845e620aa44cd46011b87159d418cb Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 6 Nov 2025 15:52:11 -0600 Subject: [PATCH] revert copilot suggestion .. we will never have more then 5 anyways --- esphome/components/wifi/wifi_component.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index d70903b0d5..c4d106c0fe 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -840,7 +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 (static_cast(this->selected_sta_index_) >= this->sta_.size() - 1) { + } else if (this->selected_sta_index_ >= static_cast(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)