diff --git a/esphome/components/wifi/wifi_component.h b/esphome/components/wifi/wifi_component.h index a8f9fa2ec42..9418165501c 100644 --- a/esphome/components/wifi/wifi_component.h +++ b/esphome/components/wifi/wifi_component.h @@ -507,7 +507,7 @@ class WiFiComponent final : public Component { /// Setup WiFi interface. void setup() override; #ifdef USE_LN882X - void on_shutdown() override; + void on_powerdown() override; #endif void start(); void dump_config() override; diff --git a/esphome/components/wifi/wifi_component_libretiny.cpp b/esphome/components/wifi/wifi_component_libretiny.cpp index 66a0d406a7a..7e2c19627b9 100644 --- a/esphome/components/wifi/wifi_component_libretiny.cpp +++ b/esphome/components/wifi/wifi_component_libretiny.cpp @@ -790,9 +790,10 @@ network::IPAddress WiFiComponent::wifi_soft_ap_ip() { return {WiFi.softAPIP()}; #endif // USE_WIFI_AP #ifdef USE_LN882X -void WiFiComponent::on_shutdown() { - // Leave the AP before a reboot: otherwise it still holds the association - // when the chip comes back and the first connects can stall or fail. +void WiFiComponent::on_powerdown() { + // Leave the AP before a reboot or deep sleep, after teardown has let the + // API say goodbye: otherwise the AP still holds the association when the + // chip comes back and the first connects can stall or fail. if (!this->is_connected()) return; ESP_LOGD(TAG, "Disconnecting before reboot");