Skip to content

Adaptive Cover Pro ⛅ v2.22.0-beta.1

Pre-release
Pre-release

Choose a tag to compare

@jrhubott jrhubott released this 19 May 15:49
· 236 commits to main since this 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/, and cover_types/ where it belongs.
  • Manual-override detection extracted from coordinator.process_entity_state_change into managers/cover_command/state_classifier.py; all five prior issue-specific fixes (#147, #172, #186, #271, #285) preserved verbatim.
  • Cover-type-specific behaviour consolidated onto CoverTypePolicy subclasses; the coordinator and pipeline handlers no longer branch on cover-type strings or hardcoded capability keys.
  • StubSingleAxisPolicy and StubDualAxisPolicy added 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: GlareZoneHandler downcast guarded; VenetianPolicy.is_in_tilt_suppression signature harmonised; return-to-default switch gate moved to a policy ClassVar; manual-override threshold deduped; custom-position priority default unified; CoverTypePolicy safe-defaults added.

  • Phase B — TimeoutController for the manager timeout pattern: Consolidates the timeout-spawn/await/expiry/nullify pattern shared by MotionManager, WeatherManager, and GracePeriodManager into managers/common/timeout_controller.py. Removes ~80 lines of duplication.

  • Phase C — DualAxisSequencer relocated to cover_types/venetian/: Moves managers/dual_axis_sequencer.py and the flat cover_types/venetian.py into a new cover_types/venetian/ package (policy.py + sequencer.py). Zero behavior change; the sequencer now lives alongside the policy that owns it.

  • Phase D — PipelineSnapshotBuilder extracted from coordinator: Five coordinator methods (~213 LOC) move into pipeline/snapshot_builder.py. Climate, force-sensor, and custom-position reads, plus snapshot assembly, are no longer inline in the coordinator.

  • Phase E — WindowTransitionTracker extracted from coordinator: ~130 lines of transition tracking move into state/window_transition_tracker.py. Removes _last_sun_validity_state and _prev_sunset_active as coordinator instance attributes.

  • Phase F — StateClassifier extracted from coordinator: Moves a 256-line manual-override detection block into managers/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 with ClassVar flags (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 StubSingleAxisPolicy and StubDualAxisPolicy; 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() and display_label() hooks. Removes hardcoded mappings from config_flow.py.

🧪 Testing

  • 3375 tests passing (up from 3367 in v2.21.5).

Compatibility

  • Home Assistant 2026.3.0+
  • Python 3.11+