From c74931aecb6d4bd9b2bfade15c619c67622eb27d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 23 Apr 2026 20:55:22 -0500 Subject: [PATCH] [mdns] Revert defines.h USE_MDNS_EVENT_DRIVEN_POLLING / USE_MDNS_WIFI_LISTENER adds Copilot flagged that defining these unconditionally in defines.h breaks static analysis on platforms that don't meet the derivation's platform+listener guard: USE_MDNS_WIFI_LISTENER enables 'public wifi::WiFiIPStateListener' inheritance in the class declaration, but wifi_component.h is only #include'd inside the mdns_component.h derivation block. On analysis envs where the derivation guard is false (non-ESP8266/RP2040, or missing listener feature flags), the inherit fires without the header in scope, causing 'use of undeclared identifier' and related errors. Letting the derivation in mdns_component.h be the sole source of truth keeps the define and its corresponding include atomically linked. --- esphome/core/defines.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/esphome/core/defines.h b/esphome/core/defines.h index 53b78a97df..80247f69da 100644 --- a/esphome/core/defines.h +++ b/esphome/core/defines.h @@ -111,8 +111,6 @@ #define MDNS_SERVICE_COUNT 3 #define USE_MDNS_DYNAMIC_TXT #define MDNS_DYNAMIC_TXT_COUNT 2 -#define USE_MDNS_EVENT_DRIVEN_POLLING -#define USE_MDNS_WIFI_LISTENER #define MICRONOVA_LISTENER_COUNT 1 #define USE_MICRONOVA_WRITER #define SERIAL_PROXY_COUNT 2