From 856b457600eff31c0c24e23d7fd58a4501ed23b7 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 9 Nov 2025 19:59:19 -0600 Subject: [PATCH] tweaks --- esphome/components/wifi/wifi_component.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index 11a22666bc..165691d446 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -1160,18 +1160,21 @@ WiFiRetryPhase WiFiComponent::determine_next_phase_() { } } // Exhausted all potentially hidden SSIDs - rescan to try next BSSID - // If captive portal/improv is active, keep rescanning + // If captive portal/improv is active, skip adapter restart and go back to start // Otherwise restart adapter to clear any stuck state if (this->is_captive_portal_active_() || this->is_esp32_improv_active_()) { - return WiFiRetryPhase::SCAN_CONNECTING; + // Go back to explicit hidden if we went through it initially, otherwise scan + return this->went_through_explicit_hidden_phase_() ? WiFiRetryPhase::EXPLICIT_HIDDEN + : WiFiRetryPhase::SCAN_CONNECTING; } // Restart adapter return WiFiRetryPhase::RESTARTING_ADAPTER; case WiFiRetryPhase::RESTARTING_ADAPTER: - // After restart, go back to scanning - return WiFiRetryPhase::SCAN_CONNECTING; + // After restart, go back to explicit hidden if we went through it initially, otherwise scan + return this->went_through_explicit_hidden_phase_() ? WiFiRetryPhase::EXPLICIT_HIDDEN + : WiFiRetryPhase::SCAN_CONNECTING; } // Should never reach here