From 7814e99b6f7b96af47ecc81c036f59bc4823e7cb Mon Sep 17 00:00:00 2001 From: kbx81 Date: Tue, 19 May 2026 23:10:32 -0500 Subject: [PATCH] fix(network): enable USE_SETUP_PRIORITY_OVERRIDE when priority is configured PR #14255 generates calls to Component::set_setup_priority(float) from ethernet/wifi to_code(), but that method's body in core/component.cpp is gated by #ifdef USE_SETUP_PRIORITY_OVERRIDE. Without the define the declaration exists but no implementation is linked, producing: undefined reference to `esphome::Component::set_setup_priority(float)` The existing convention in cpp_helpers.register_component() is to add the define whenever CONF_SETUP_PRIORITY appears in a component's YAML. Mirror that here: when the user declares `network: priority:`, the priority-driven setup_priority overrides will be emitted, so the define must be on. --- esphome/components/network/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esphome/components/network/__init__.py b/esphome/components/network/__init__.py index 6243bd3146..9d13111621 100644 --- a/esphome/components/network/__init__.py +++ b/esphome/components/network/__init__.py @@ -335,6 +335,10 @@ async def to_code(config): if CONF_PRIORITY in config: priority_list = config[CONF_PRIORITY] CORE.data[KEY_NETWORK_PRIORITY] = priority_list + # Enable Component::set_setup_priority() so the per-interface to_code + # calls below have a defined symbol to link against. Without this define + # the implementation in core/component.cpp is compiled out. + cg.add_define("USE_SETUP_PRIORITY_OVERRIDE") def _fmt(entry): if entry["timeout"] is not None: