Repository navigation
feat(discovery): reusable sweep poll gate, dimmer capability probe, and legacy YAML migration (#733) - #742
Merged
GreenGrassBlueOcean merged 5 commits intoOct 20, 2026
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
GreenGrassBlueOcean
force-pushed
the
arch/issue-734-bus-truthful-state-and-resync
branch
from
October 17, 2026 10:15
f941dc1 to
1aedd67
Compare
GreenGrassBlueOcean
force-pushed
the
arch/issue-733-sweep-gating-and-yaml-migration
branch
from
October 17, 2026 10:16
f77599f to
91ce456
Compare
GreenGrassBlueOcean
force-pushed
the
arch/issue-734-bus-truthful-state-and-resync
branch
from
October 17, 2026 10:40
1aedd67 to
7eb1348
Compare
GreenGrassBlueOcean
force-pushed
the
arch/issue-733-sweep-gating-and-yaml-migration
branch
from
October 17, 2026 10:40
91ce456 to
461550b
Compare
GreenGrassBlueOcean
force-pushed
the
arch/issue-734-bus-truthful-state-and-resync
branch
from
October 19, 2026 09:49
7eb1348 to
348d40b
Compare
GreenGrassBlueOcean
force-pushed
the
arch/issue-733-sweep-gating-and-yaml-migration
branch
from
October 19, 2026 09:54
461550b to
0479504
Compare
GreenGrassBlueOcean
force-pushed
the
arch/issue-733-sweep-gating-and-yaml-migration
branch
from
October 19, 2026 12:37
0479504 to
9a83cf6
Compare
GreenGrassBlueOcean
force-pushed
the
arch/issue-734-bus-truthful-state-and-resync
branch
from
October 19, 2026 12:37
348d40b to
e5ea6cd
Compare
Base automatically changed from
arch/issue-734-bus-truthful-state-and-resync
to
v2-phase1-architecture
October 20, 2026 19:06
…nto arch/issue-733-sweep-gating-and-yaml-migration
…ml copy current (#733, #742) Sweep gate - Count the startup sweep like any other paced sweep; drop the private _startup keyword. - close_listener() bumps a sweep epoch, so a sweep still running before a reconnect cannot end a sweep started after it. myhome.yaml copy in the entry options - Refresh the copy whenever the validated section changed; only the first copy raises legacy_yaml_imported. An empty section (<mac>: {}) empties it. - Fall back to the copy whenever the file yields no section for the gateway: missing, empty, unparsable, invalid, ambiguous top-level platforms, or no section for this MAC. - Keep a device that the validator files under several keys (zone aliases, the button platform) one object, live and when restored from JSON. - Store the copy as plain JSON; drop the test-only guards. Repair text, docs and the upgrade guide describe the refresh and fallback; fr/it/nl now carry the full description. Tests: reconnect race, startup sweep counted, full-integration myhome.sweep_bus run holding back a new cover and heating zone, real Dimension 1 promotion during a sweep, YAML refresh/fallback/identity. The blank-start old-path test now waits for the startup sweep instead of faking its end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GreenGrassBlueOcean
deleted the
arch/issue-733-sweep-gating-and-yaml-migration
branch
October 20, 2026 20:01
GreenGrassBlueOcean
added a commit
that referenced
this pull request
Oct 20, 2026
) Bring in #742 (sweep gating, myhome.yaml copy in entry options) and #744 (#732 modularization of config_flow, gateway and platforms). Conflicts: - validate.py: import list; keep both CONF_STEP_*_ACTION and CONF_STRATEGY. - legacy_yaml.py: keep the base's _load_live_yaml/_apply_yaml_platforms structure and re-apply the expose handling on top: a top-level `expose:` key counts as single-gateway config, the where-filling loop skips `expose`, and the validated expose list is collected into configured_expose (threaded through _load_live_yaml). - config_flow.py: take the base's split module and move ExposeSubentryFlowHandler into config_flow_expose.py, next to config_flow_options.py; config_flow.py keeps async_get_supported_subentry_types and re-exports the handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 4 tasks
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #733 (parts 1 and 2, and the import half of part 3)
Part 3 of #733 also asks to stop reading
myhome.yamlon every start and to simplifyPlatformDiscovery. That is not in this PR: while the file exists it stays in charge.What is the problem
MyHOMEEntity.async_added_to_hass()deferred_poll_on_addonly while the one-shot startup sweep ran. An entity discovered duringmyhome.sweep_busfrom a frame without full state (a moving cover, a heating zone) polled at once, mid-sweep (Fresh install without myhome.yaml: lights are never queried, and discovery follow-ups cut status replies short #578).*#1*0##with a plain*1*1*W##(live MH200 capture below), so a bus-discovered light may start asColorMode.ONOFFwith nothing asking it for Dimension 1.myhome.yaml. Device settings that only exist inmyhome.yaml(travel times, feature flags) are lost when the file is removed or becomes unreadable.How is it solved
gateway.py,myhome_device.py)send_paced()run, the startup sweep included, is counted in_active_sweeps, exposed assweep_active.wait_for_initial_discovery()also waits for the sweep to go idle._poll_on_adduntil it is done.close_listener()resets the count and bumps an epoch, so a sweep that was still running before a reconnect cannot end a sweep started after it.light.py)*#1*W*1##once the sweep is done.myhome.yamlin the entry options (legacy_yaml.py,repairs.py)entry.options["migrated_yaml_platforms"].legacy_yaml_importedissue. Later starts refresh the copy when the file changed, and an empty section (<mac>: {}) empties it.buttonplatform) stays one object, both on the live path and when restored from the JSON copy.dict(entry.options)). Writing it during setup does not reload the entry (OptionsFlowWithReload, no update listener). The issue is removed with the entry.How is it tested
tests/test_sweep_pacing.py:sweep_activeduringsend_paced()and duringinitial_discovery();wait_for_initial_discovery()waits for an active sweep; a sweep cut short byclose_listener()cannot end the next sweep.myhome.sweep_busis held on its first general request, a moving cover*2*1*19##and zone 2 (*#4*2*0*0215##) are discovered, and neither*#2*19##nor*#4*2…is sent until the sweep is done.*#1*W*1##after the sweep; no probe for a dimmable light; no probe when a level frame promotes the light during the sweep.Full suite against the released OWNd pinned in
manifest.json(2.0.0b11): 4353 passed, 100.0% statement coverage.ruff,mypy --strict,verify_ha_standards.pyandsync_documentation.py --checkare clean.Where are the traces
test/issue-733-mh200-dim1-probe-trace, with replay tests):tests/fixtures/traces/issue_733/myhome_trace_MH200_dim1_probe_2026-10-20T19-22-47.json(README). It is a live BTicino MH200 capture (firmware 2.1.0), anonymised, event session only: a*#1*0##sweep, then*#1*W*1##to three ON relays, one OFF relay and two ON F418U2 dimmer channels. This PR does not need the fixture to pass.What does the capture / Oracle / Encyclopedia say
*#1*81*1##,*#1*84*1##,*#1*57*1##*1*1*W##*#1*11*1##*1*0*11##*#1*29*1##*1*1*29##,*#1*29*1*200*2##,*1*1*29##*#1*67*1##*1*1*67##,*#1*67*1*174*2##,*1*1*67##*#1*0##with*1*1*W##and only later in the same sweep with their level (*1*10*29##,*1*9*67##). Most ON dimmers are therefore promoted by the sweep itself, and the probe only covers the ones that never send their level.*#1*31*1##(no device behind it) is put on the bus by every emulated gateway except the F450, which drops it. The command session NACKs it, except on the MH202. The oracle has no data on how probes and sweeps interleave.DIMENSION 1. It records that an F454 answered a Dimension 1 request on an OFF F418U2 asDIMENSION 4. The probe only targets ON lights, but the answer of an F454 to an ON relay is unrecorded.🤖 Generated with Claude Code