From 2480663b87396ad410e1152805849419ba6bd030 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 9 Nov 2025 16:32:05 -0600 Subject: [PATCH] much simpler --- esphome/components/wifi/wifi_component.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index 90db3705dc..f30695ca7f 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -1128,6 +1128,17 @@ void WiFiComponent::retry_connect() { this->error_from_callback_ = false; + // Check if we need scan results but don't have valid ones + if (this->needs_scan_results_()) { + ESP_LOGD(TAG, "No valid scan results, skipping connection attempt"); + // Skip to phase transition logic (will trigger scan or move to next phase) + WiFiRetryPhase next_phase = this->determine_next_phase_(); + if (next_phase != this->retry_phase_) { + this->transition_to_phase_(this->retry_phase_, next_phase); + } + return; + } + // Execute phase-specific connection logic if (this->state_ == WIFI_COMPONENT_STATE_STA_CONNECTING) { yield();