Advertise dashboard over mDNS in HA addon mode#1367
Conversation
The addon runs with host networking, so the mDNS announce reaches the LAN; the Desktop app can now discover that a builder is running. Filter the Supervisor hassio bridge out of the announced addresses, the same way docker0 already was, so we never advertise an unreachable 172.30.32.x address. The advertise is discovery only; the peer-link receiver stays default off on the addon.
Merging this PR will not alter performance
Comparing Footnotes
|
PR Review — Advertise dashboard over mDNS in HA addon modeFocused, well-tested change — merge-ready.
Automated review by Kōan (Claude) |
esphbot
left a comment
There was a problem hiding this comment.
No blocking issues found.
There was a problem hiding this comment.
Pull request overview
This PR enables the backend to advertise the Device Builder dashboard over mDNS when running as a Home Assistant add-on, allowing LAN discovery (e.g., by ESPHome Desktop) in add-on deployments. It also avoids advertising host-internal Supervisor networking addresses by filtering the hassio bridge interface out of the address selection used for announcements.
Changes:
- Remove the HA add-on guard that previously skipped dashboard mDNS advertising, so advertising occurs whenever zeroconf is available.
- Filter the HA Supervisor
hassiobridge interface from_local_addresses()so announcements don’t publish unreachable172.30.32.0/23addresses. - Extend unit/integration tests to cover the add-on network layout and the “advertise in add-on mode” behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/test_dashboard_advertise.py |
Adds HA add-on bridge filtering coverage and updates the DeviceBuilder lifecycle test to expect mDNS registration in add-on mode. |
esphome_device_builder/helpers/dashboard_advertise.py |
Treats hassio* interfaces as virtual bridges so their addresses are excluded from advertised A/AAAA records. |
esphome_device_builder/device_builder.py |
Advertises the dashboard in HA add-on mode when zeroconf is available, instead of skipping unconditionally. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1367 +/- ##
==========================================
- Coverage 99.49% 99.49% -0.01%
==========================================
Files 221 221
Lines 16991 16989 -2
==========================================
- Hits 16906 16904 -2
Misses 85 85
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
What does this implement/fix?
The dashboard now advertises itself over mDNS when running as a Home Assistant addon, so the ESPHome Desktop app can discover that a builder is running on the network. Previously the advertise was skipped entirely in addon mode.
The addon runs with host networking, so the announce carries the host LAN IP and reaches peers. The one wrinkle is that the container also sees the Supervisor
hassiobridge (172.30.32.0/23); that address is host internal, so it is now filtered out the same waydocker0already was, and we never advertise an unreachable172.30.32.xaddress.The advertise is discovery only; the peer-link receiver stays default off on the addon, so the announce carries
server_versionandesphome_versionbut nopin_sha256orremote_build_port. The companion frontend PR uses that absence to hide the addon dashboard from the send builds list, since it cannot accept builds.Related issue or feature (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocsmaintenancecidependenciesFrontend coordination
Checklist
ruff,codespell, yaml/json/python checks).tests/where applicable.components.index.json/definitions/components/*.jsonhave not been hand-edited (regenerate viascript/sync_components.pyif a sync is needed).docs/ARCHITECTURE.mdand/ordocs/API.md.