1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 16:51:52 +00:00

[libretiny] Fix WiFi scan timeout loop when scan fails

This commit is contained in:
J. Nick Koston
2025-12-07 21:54:09 -06:00
parent c5cc91f6f0
commit da4bd321f0

View File

@@ -445,6 +445,7 @@ bool WiFiComponent::wifi_scan_start_(bool passive) {
}
void WiFiComponent::wifi_scan_done_callback_() {
this->scan_result_.clear();
this->scan_done_ = true;
int16_t num = WiFi.scanComplete();
if (num < 0)
@@ -463,7 +464,6 @@ void WiFiComponent::wifi_scan_done_callback_() {
ssid.length() == 0);
}
WiFi.scanDelete();
this->scan_done_ = true;
#ifdef USE_WIFI_LISTENERS
for (auto *listener : this->scan_results_listeners_) {
listener->on_wifi_scan_results(this->scan_result_);