diff --git a/esphome/components/wifi/wifi_component_libretiny.cpp b/esphome/components/wifi/wifi_component_libretiny.cpp index 4a16139e3cd..2bc81952071 100644 --- a/esphome/components/wifi/wifi_component_libretiny.cpp +++ b/esphome/components/wifi/wifi_component_libretiny.cpp @@ -792,7 +792,7 @@ network::IPAddress WiFiComponent::wifi_soft_ap_ip() { return {WiFi.softAPIP()}; #ifdef USE_LN882X void WiFiComponent::on_powerdown() { // Leave the AP so it no longer holds the association when we come back. - if (!this->is_connected()) + if (WiFi.status() != WL_CONNECTED) // associated, even before DHCP has finished return; ESP_LOGD(TAG, "Disconnecting before powerdown"); wifi_sta_disconnect(); // not WiFi.disconnect(): it frees the SSID its event handlers read