1
0
mirror of https://github.com/esphome/esphome.git synced 2025-01-18 03:55:40 +00:00

Fix compile errors with pioarduino/platform-espressif32: wifi_component_esp32_arduino.cpp (#7998)

This commit is contained in:
Ryan Henderson 2025-01-12 20:17:28 -08:00 committed by GitHub
parent 8fbd512952
commit 3fa67fad32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,11 @@
#ifdef USE_WIFI_WPA2_EAP
#include <esp_wpa2.h>
#endif
#ifdef USE_WIFI_AP
#include "dhcpserver/dhcpserver.h"
#endif // USE_WIFI_AP
#include "lwip/apps/sntp.h"
#include "lwip/dns.h"
#include "lwip/err.h"
@ -638,7 +643,12 @@ void WiFiComponent::wifi_event_callback_(esphome_wifi_event_id_t event, esphome_
}
WiFiSTAConnectStatus WiFiComponent::wifi_sta_connect_status_() {
auto status = WiFiClass::status();
#if USE_ARDUINO_VERSION_CODE < VERSION_CODE(3, 1, 0)
const auto status = WiFiClass::status();
#else
const auto status = WiFi.status();
#endif
if (status == WL_CONNECT_FAILED || status == WL_CONNECTION_LOST) {
return WiFiSTAConnectStatus::ERROR_CONNECT_FAILED;
}