Repository navigation
Probe seeded non-mDNS API devices once to verify live identity - #3071
Hasan Khalil (gongloo) wants to merge 2 commits into
Conversation
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3071 +/- ##
========================================
Coverage 99.77% 99.77%
========================================
Files 300 305 +5
Lines 26564 27006 +442
========================================
+ Hits 26503 26945 +442
Misses 61 61
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
PR Review — Probe seeded non-mDNS API devices once to verify live identityCorrect, well-scoped fix for seeded ping/MQTT What works well: the new
🟢 Suggestions
1. Systemic-failure warning now counts devices that already have MAC/version, but its text says those may stay blank
|
ESPHome Bot (esphbot)
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the live-identity verification changes.
No open issues 🎉
What changed in this PR
This PR fixes live-identity verification for API devices whose metadata is restored after a dashboard restart but which come online through ping or MQTT rather than mDNS.
Changes:
- Probe seeded, non-mDNS API devices until their live identity is verified.
- Avoid a failure cooldown when a successful probe confirms existing metadata and clears the need to probe.
- Add ping/MQTT regression coverage and update fixtures to distinguish populated metadata from verified identity.
| File | Description |
|---|---|
tests/test_mdns_cache_reconcile.py |
Makes mDNS ownership explicit in the cache-reconciliation test. |
tests/test_api_info_fallback.py |
Adds seeded-device verification coverage and updates identity fixtures. |
esphome_device_builder/controllers/_device_state_monitor/api_info.py |
Updates probe eligibility and successful-confirmation cooldown handling. |
Review effort: Balanced (adaptive)
|
Thanks for the review! Both suggestions have been addressed in
(Note on the summary's |
Grégoire Seux (kamaradclimber)
left a comment
There was a problem hiding this comment.
I'm also affected by this issue. PR looks good to me! Let's wait for maintainer to look into it.
What does this implement/fix?
On restart,
mac_addressanddeployed_versionare seeded from the sidecar store whileruntime_state.deployed_identity_livestartsFalse. When anapi:device comes online via ping or MQTT without mDNS discovery (priority_for != ReachabilitySource.MDNS),ApiInfoSource._is_duepreviously skipped probing because both fields were already populated, leavingdeployed_identity_livepermanentlyFalseand keeping the UI gated on"Waiting for mDNS discovery…".not runtime.deployed_identity_liveinApiInfoSource._is_due's non-mDNS branch so online ping/MQTT-ownedapi:devices probe once per session to stampdeployed_identity_live=True.ApiInfoSource._fetch, avoid recording a failure cooldown when a connected probe stampsdeployed_identity_live=Trueon an already-seeded device and nothing remains due."MAC/version may stay blank or unverified") since ping/MQTT-owned seeded devices whose API probe cannot succeed now retry every failure cooldown (600s) and count toward that warning.PING/MQTT) and cooldown backoff when a connected probe returns no identity, and align existing unit tests whose fixtures assumed both fields populated implied live/mDNS-owned identity.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.