Adaptive Cover Pro ⛅ v2.22.0-beta.1
Pre-releaseℹ Using release notes from: release_notes/v2.22.0-beta.1.md
v2.22.0-beta.1
🎯 v2.22.0-beta.1 — Internal Refactor (Developer Beta)
Nine-phase internal refactor that restructures cover_types/, managers/, state/, and pipeline/ to make adding new cover types tractable without forking coordinator logic. No user-visible changes, no config changes, no bug fixes.
⚠️ Should I install this?
Only install this beta if you are currently experiencing a bug and have been asked to test it, or if you are a developer working on the integration.
If you are on v2.21.5 and it is working correctly, stay there. This release exists to validate that the refactor introduced no regressions, not to deliver new capabilities. There is nothing here for users who are not hitting an active problem.
🔑 Highlights
- Coordinator shrunk by ~640 lines of code; responsibility distributed into
managers/,state/,pipeline/, andcover_types/where it belongs. - Manual-override detection extracted from
coordinator.process_entity_state_changeintomanagers/cover_command/state_classifier.py; all five prior issue-specific fixes (#147, #172, #186, #271, #285) preserved verbatim. - Cover-type-specific behaviour consolidated onto
CoverTypePolicysubclasses; the coordinator and pipeline handlers no longer branch on cover-type strings or hardcoded capability keys. StubSingleAxisPolicyandStubDualAxisPolicyadded as canary types; ~60 regression tests now run across all real and stub policies to catch future regressions early.- Net diff: 62 files changed, +3,682 / −1,251 lines.
🧹 Chores
-
Phase A — latent-defect cleanup at the policy boundary: Six surgical fixes around
CoverTypePolicy:GlareZoneHandlerdowncast guarded;VenetianPolicy.is_in_tilt_suppressionsignature harmonised; return-to-default switch gate moved to a policyClassVar; manual-override threshold deduped; custom-position priority default unified;CoverTypePolicysafe-defaults added. -
Phase B —
TimeoutControllerfor the manager timeout pattern: Consolidates the timeout-spawn/await/expiry/nullify pattern shared byMotionManager,WeatherManager, andGracePeriodManagerintomanagers/common/timeout_controller.py. Removes ~80 lines of duplication. -
Phase C —
DualAxisSequencerrelocated tocover_types/venetian/: Movesmanagers/dual_axis_sequencer.pyand the flatcover_types/venetian.pyinto a newcover_types/venetian/package (policy.py+sequencer.py). Zero behavior change; the sequencer now lives alongside the policy that owns it. -
Phase D —
PipelineSnapshotBuilderextracted from coordinator: Five coordinator methods (~213 LOC) move intopipeline/snapshot_builder.py. Climate, force-sensor, and custom-position reads, plus snapshot assembly, are no longer inline in the coordinator. -
Phase E —
WindowTransitionTrackerextracted from coordinator: ~130 lines of transition tracking move intostate/window_transition_tracker.py. Removes_last_sun_validity_stateand_prev_sunset_activeas coordinator instance attributes. -
Phase F —
StateClassifierextracted from coordinator: Moves a 256-line manual-override detection block intomanagers/cover_command/state_classifier.py. Issue-specific logic for #147, #172, #186, #271, and #285 is preserved exactly. -
Phase G — eliminate last cover-type literals, harden guard: Replaces remaining
SensorType.VENETIAN ==checks withClassVarflags (exposes_dual_axis_sensor,custom_position_includes_tilt). Adds a regression guard that scans for banned literal patterns to prevent the pattern from re-entering. -
Phase H — stub policies + parametrised cross-type invariants: Introduces
StubSingleAxisPolicyandStubDualAxisPolicy; production code must tolerate an unknown policy. Parametrises ~60 regression tests across all real and stub policies. -
Phase I — wiki anchor + display label onto the policy: Consolidates per-type label and wiki-URL mappings onto
CoverTypePolicy.wiki_anchor()anddisplay_label()hooks. Removes hardcoded mappings fromconfig_flow.py.
🧪 Testing
- 3375 tests passing (up from 3367 in v2.21.5).
Compatibility
- Home Assistant 2026.3.0+
- Python 3.11+