1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-20 00:35:44 +00:00
This commit is contained in:
J. Nick Koston
2025-11-06 17:43:52 -06:00
parent 282f6e04b3
commit d96e8a9c4b

View File

@@ -349,10 +349,10 @@ void WiFiComponent::clear_sta() {
} }
WiFiAP WiFiComponent::build_wifi_ap_from_selected_() const { WiFiAP WiFiComponent::build_wifi_ap_from_selected_() const {
WiFiAP params = this->get_sta();
// PRECONDITION: selected_sta_index_ must be valid (ensured by all callers) // PRECONDITION: selected_sta_index_ must be valid (ensured by all callers)
// If SSID is empty, it means selected_sta_index_ was invalid - this is a bug const WiFiAP *config = this->get_selected_sta_();
assert(!params.get_ssid().empty()); assert(config != nullptr);
WiFiAP params = *config;
// SYNCHRONIZATION: selected_sta_index_ and scan_result_[0] are kept in sync: // SYNCHRONIZATION: selected_sta_index_ and scan_result_[0] are kept in sync:
// - wifi_scan_done() sorts all scan results by priority/RSSI (best first) // - wifi_scan_done() sorts all scan results by priority/RSSI (best first)