Skip to content

v0.81.0 — platform contract foundation

Choose a tag to compare

@dzerik dzerik released this 04 Jun 17:21
· 7 commits to main since this release

Internal architecture refactor. No user-facing behavior change — all entities, brewing, settings, Sommelier work identically.

This release lands the foundation for a transport-agnostic coffee-machine platform: a clean contract that HA entities and the Sommelier consume, decoupled from the concrete BLE client. It bundles three internal phases.

Phase 1a — contract foundation

  • New self-contained coffee_platform/ subpackage with a CoffeeMachineClient Protocol (the transport-agnostic high-level surface) and a MachineRegistry.
  • MelittaBleClient is verified to satisfy the contract via a compliance test.
  • The Sommelier path stopped reaching into the client's private _capabilities attribute — routed through the public capabilities property.
  • sensor.py migrated to the contract as the pilot.

Phase 1b — full consumer migration

  • All remaining consumer files migrated from the concrete MelittaBleClient type hint to the CoffeeMachineClient contract: button, select, number, switch, text, time, binary_sensor, entity (the device mixin base), diagnostics.
  • __init__.py intentionally retains MelittaBleClient — it's the composition root that constructs the concrete client.

Phase 2a — platform owns the domain vocabulary

  • The shared brand-agnostic types — status enums (MachineProcess, SubProcess, InfoMessage, Manipulation), MachineStatus, capability descriptors, MachineCapabilities, BrandProfile, FeatureNotSupported — moved into coffee_platform/domain.py.
  • The old locations (brands/base.py, protocol.py, const.py) are now thin re-export shims, so all existing imports keep working unchanged (zero import-site churn across ~30 sites).
  • The CoffeeMachineClient contract drops its Any placeholders and references the real types.
  • coffee_platform/ is now fully self-contained (stdlib-only, no imports back into the integration) — enforced by an AST test — and ready for extraction to a standalone package.

Tests

New tests/coffee_platform/ suite (contract compliance, private-leak guard, registry behavior, domain self-containment + shim identity). Full suite: 1000 passed (was 992).

Full changelog