From 8a927918872bc328ae2d7823e0cc81203a27628a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 6 Nov 2025 16:08:14 -0600 Subject: [PATCH] remove non-logical check --- esphome/components/wifi/wifi_component.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index 38d4fc44b5..8812f1becf 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -382,15 +382,11 @@ WiFiAP WiFiComponent::build_selected_ap_() const { // Therefore scan_result_[0] is guaranteed to match sta_[selected_sta_index_] if (!this->scan_result_.empty()) { const WiFiScanResult &scan = this->scan_result_[0]; - - if (!params.get_hidden()) { - // Selected network is visible, override with data from the scan. - // Limit the connect params to only connect to exactly this network - // (network selection is done during scan phase). - params.set_ssid(scan.get_ssid()); - params.set_bssid(scan.get_bssid()); - params.set_channel(scan.get_channel()); - } + // If we have scan data, the network is visible (not hidden) - use it regardless of config + // Hidden networks don't appear in scan results, so presence of scan data is ground truth + params.set_ssid(scan.get_ssid()); + params.set_bssid(scan.get_bssid()); + params.set_channel(scan.get_channel()); } return params;