1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-20 00:35:44 +00:00

remove non-logical check

This commit is contained in:
J. Nick Koston
2025-11-06 16:08:14 -06:00
parent 7041c3324b
commit 8a92791887

View File

@@ -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;