mirror of
https://github.com/esphome/esphome.git
synced 2025-11-20 08:46:01 +00:00
remove non-logical check
This commit is contained in:
@@ -382,15 +382,11 @@ WiFiAP WiFiComponent::build_selected_ap_() const {
|
|||||||
// Therefore scan_result_[0] is guaranteed to match sta_[selected_sta_index_]
|
// Therefore scan_result_[0] is guaranteed to match sta_[selected_sta_index_]
|
||||||
if (!this->scan_result_.empty()) {
|
if (!this->scan_result_.empty()) {
|
||||||
const WiFiScanResult &scan = this->scan_result_[0];
|
const WiFiScanResult &scan = this->scan_result_[0];
|
||||||
|
// If we have scan data, the network is visible (not hidden) - use it regardless of config
|
||||||
if (!params.get_hidden()) {
|
// Hidden networks don't appear in scan results, so presence of scan data is ground truth
|
||||||
// Selected network is visible, override with data from the scan.
|
params.set_ssid(scan.get_ssid());
|
||||||
// Limit the connect params to only connect to exactly this network
|
params.set_bssid(scan.get_bssid());
|
||||||
// (network selection is done during scan phase).
|
params.set_channel(scan.get_channel());
|
||||||
params.set_ssid(scan.get_ssid());
|
|
||||||
params.set_bssid(scan.get_bssid());
|
|
||||||
params.set_channel(scan.get_channel());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
|
|||||||
Reference in New Issue
Block a user