docs: add an example for re-announcing on interface changes#1803
Conversation
|
|
bluetoothbot
left a comment
There was a problem hiding this comment.
Blocking issues found.
- Example is built on deprecated get_all_addresses / get_all_addresses_v6
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1803 +/- ##
=======================================
Coverage 99.81% 99.81%
=======================================
Files 33 33
Lines 3750 3750
Branches 533 533
=======================================
Hits 3743 3743
Misses 5 5
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
All addressed in 71ffff3:
Verified the snapshot raises no DeprecationWarning under -W error. |
PR Review — docs: add an example for re-announcing on interface changesSolid, runnable example — the prior blocking issue is resolved and the lifecycle handling is the part worth getting right, and it's correct. Strengths:
No blocking issues. The Checklist
Automated review by Kōan (Claude) |
bluetoothbot
left a comment
There was a problem hiding this comment.
No blocking issues found.
Summary
Adds a runnable example showing how to re-announce services when the host's network interfaces change, using
async_update_interfaces()from #1797.zeroconf does not poll for interface changes itself; detection is platform specific and is best driven from whatever signal a host already has. When none is available, a small periodic poller is enough: snapshot the addresses and reconcile only when they change. The example also shows the part worth getting right, cancelling the monitor task before closing the instance.
This is the alternative to a built-in monitor (#1798, closed); the polling loop is small and belongs to the consumer, while the reconcile API does the hard part.
Test plan
examples/async_interface_monitor.pyimports and runs;pre-commit runclean (ruff, format, flake8, mypy)