cremalink.ecam.machine_profiles module

Machine dialect profiles for the ECAM protocol layer.

Different De’Longhi machine families speak slightly different dialects of the same Ayla/ECAM protocol. Rather than scattering if model == ... checks throughout the code, each family’s differences live in one frozen MachineProfile here, bound explicitly via the machine_profile field of the device map (FR-006).

class cremalink.ecam.machine_profiles.MachineProfile(key: str, command_property: str, trailer: str, session: str, monitor_request_ids: frozenset[int], profile_entry_size: int, grinder_scale: float)[source]

Bases: object

Dialect declaration a device binds to via machine_profile.

Fields:

  • key: stable identifier ("non_striker" / "striker").

  • command_property: property frames are written to (data_request vs app_data_request).

  • trailer: transport suffix after the timestamp (NONE timestamp only, APP_ID 4-byte registered app id).

  • session: write-gate mechanism (plain unix timestamp write to device_connected vs 0xE8 handshake + 84 0f 03 02 registration).

  • monitor_request_ids: request ids that carry monitor frames (the device map’s monitor_profile stays authoritative per data-model.md; this is informational).

  • profile_entry_size: bytes per profile entry in 0xA4 blobs (21 non-striker / 22 striker incl. mug byte).

  • grinder_scale: multiplier applied to bean-system grinder values on striker (write *2, read /2 per APK O0/G0).

command_property: str
grinder_scale: float
key: str
monitor_request_ids: frozenset[int]
profile_entry_size: int
session: str
trailer: str
cremalink.ecam.machine_profiles.profile_from_map(map_data: dict[str, Any], *, logger_: Logger | None = None) → MachineProfile[source]

Bind the device map’s machine_profile field to a preset.

A missing field binds NON_STRIKER with a logged warning (the verified Soul behaviour). An unrecognized value raises ValueError — failing closed is required because command construction on the wrong dialect produces frames the machine ignores (FR-006).