1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 08:15:49 +00:00

defensive to make bot happy

This commit is contained in:
J. Nick Koston
2025-11-06 15:44:48 -06:00
parent b366bc8dba
commit 0eafe5259f
2 changed files with 6 additions and 1 deletions

View File

@@ -365,7 +365,7 @@ WiFiAP WiFiComponent::build_selected_ap_() const {
// For hidden networks, clear BSSID and channel even if set in config
// There might be multiple hidden networks with same SSID but we can't know which is correct
// Rely on probe-req with just SSID. Empty channel triggers ALL_CHANNEL_SCAN.
// Note: Scan data is never used for hidden networks (see check below at line ~390)
// Note: Scan data is never used for hidden networks (see !params.get_hidden() check below)
params.set_bssid(optional<bssid_t>{});
params.set_channel(optional<uint8_t>{});
} else {

View File

@@ -358,7 +358,12 @@ class WiFiComponent : public Component {
// Set selected sta with a temporary scan result (fast connect path)
void set_selected_sta_with_scan_(int8_t sta_index, const WiFiScanResult &scan) {
#ifdef USE_RP2040
this->scan_result_.clear();
this->scan_result_.reserve(1);
#else
this->scan_result_.init(1);
#endif
this->scan_result_.push_back(scan);
this->selected_sta_index_ = sta_index;
}