v0.81.0 — platform contract foundation
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 aCoffeeMachineClientProtocol (the transport-agnostic high-level surface) and aMachineRegistry. MelittaBleClientis verified to satisfy the contract via a compliance test.- The Sommelier path stopped reaching into the client's private
_capabilitiesattribute — routed through the publiccapabilitiesproperty. sensor.pymigrated to the contract as the pilot.
Phase 1b — full consumer migration
- All remaining consumer files migrated from the concrete
MelittaBleClienttype hint to theCoffeeMachineClientcontract:button,select,number,switch,text,time,binary_sensor,entity(the device mixin base),diagnostics. __init__.pyintentionally retainsMelittaBleClient— 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 intocoffee_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
CoffeeMachineClientcontract drops itsAnyplaceholders 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).