mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
ceada8632553398018656a273a8a8f7a3e598b2d
Extends the WiFi-only listener pattern from the previous commit to also subscribe to EthernetIPStateListener when Ethernet is configured. RP2040 can run mDNS over a W5500 ethernet shield without WiFi, and mDNS and WiFi are mutually exclusive on RP2040 (the framework doesn't support both simultaneously on the CYW43/PIO paths), so this adds the ethernet-only path without touching the WiFi path. ESPHome's wifi and ethernet components already publish compatible IP state listener APIs (`WiFiIPStateListener::on_ip_state` and `EthernetIPStateListener::on_ip_state` with identical signatures). MDNSComponent multiply-inherits both when available; a single on_ip_state() override satisfies both vtable entries. - New `USE_MDNS_WIFI_LISTENER` / `USE_MDNS_ETHERNET_LISTENER` gates control per- interface subscription. `USE_MDNS_EVENT_DRIVEN_POLLING` fires if either is available. - Python side now calls `ethernet.request_ethernet_ip_state_listener()` when ethernet is in the config (RP2040 only — ESP8266 has no ethernet driver). - setup() seeds current state for each registered listener so an already-up interface still triggers MDNS.begin() + polling window under AFTER_CONNECTION priority. Tests: adds `test-enabled-ethernet.rp2040-ard.yaml` covering the ethernet-only path. Existing `test-enabled.rp2040-ard.yaml` (WiFi-only) and ESP8266 tests continue to pass.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
546 MiB
Languages
C++
60.1%
Python
39.3%
C
0.3%
JavaScript
0.2%
