From 46cc9c0eefd4e6ff49066e37bdacf87442c180c4 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 14 Feb 2026 05:24:52 -0700 Subject: [PATCH] =?UTF-8?q?[wifi]=20Simplify=20comment=20=E2=80=94=20remov?= =?UTF-8?q?e=20unverified=20link=20state=20claim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cannot confirm wifi_station_disconnect() synchronously clears the lwIP netif LINK_UP flag on ESP8266 NONOS SDK. The comment doesn't need to make claims about link state since the fix is simply that the hostname never changes at runtime, making dhcp_renew() pointless. Co-Authored-By: Claude Opus 4.6 --- esphome/components/wifi/wifi_component_esp8266.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/esphome/components/wifi/wifi_component_esp8266.cpp b/esphome/components/wifi/wifi_component_esp8266.cpp index 6f8decc0ae..cbf7d7d80f 100644 --- a/esphome/components/wifi/wifi_component_esp8266.cpp +++ b/esphome/components/wifi/wifi_component_esp8266.cpp @@ -217,10 +217,9 @@ bool WiFiComponent::wifi_apply_hostname_() { } // Update hostname on all lwIP interfaces so DHCP packets include it. - // No dhcp_renew() call here — the hostname is fixed at compile time and - // this function is only called during setup() or wifi_sta_connect_() when - // the interface is always disconnected. lwIP includes the hostname in - // DHCP DISCOVER/REQUEST automatically via LWIP_NETIF_HOSTNAME. + // lwIP includes the hostname in DHCP DISCOVER/REQUEST automatically + // via LWIP_NETIF_HOSTNAME — no dhcp_renew() needed. The hostname is + // fixed at compile time and never changes at runtime. for (netif *intf = netif_list; intf; intf = intf->next) { #if LWIP_VERSION_MAJOR == 1 intf->hostname = (char *) wifi_station_get_hostname();