From 6dcfad1e444d5a3bd113f65d9d24dfb8003624a6 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 4 Oct 2026 21:59:07 -0500 Subject: [PATCH] [wifi] Leave the AP on LN882x powerdown whenever associated, even before DHCP --- esphome/components/wifi/wifi_component_libretiny.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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