1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-02 01:52:21 +01:00

Fix some issues with wifi driver after IDF refactor (#2387)

This commit is contained in:
Otto Winter
2021-09-25 09:16:32 +02:00
committed by GitHub
parent 8503e08ee6
commit 278863d027
3 changed files with 102 additions and 81 deletions

View File

@@ -377,17 +377,20 @@ bool WiFiComponent::wifi_sta_connect_(const WiFiAP &ap) {
}
#endif // USE_WIFI_WPA2_EAP
// Reset flags, do this _before_ wifi_station_connect as the callback method
// may be called from wifi_station_connect
s_sta_connecting = true;
s_sta_connected = false;
s_sta_got_ip = false;
s_sta_connect_error = false;
s_sta_connect_not_found = false;
err = esp_wifi_connect();
if (err != ESP_OK) {
ESP_LOGW(TAG, "esp_wifi_connect failed: %s", esp_err_to_name(err));
return false;
}
s_sta_connecting = true;
s_sta_connected = false;
s_sta_got_ip = false;
s_sta_connect_error = false;
s_sta_connect_not_found = false;
return true;
}