cremalink.clients package
This package provides high-level client interfaces for interacting with the cremalink system.
The Client class from the cloud module is exposed as the primary entry point for this package.
- class cremalink.clients.Client(token_path: str, *, logger: Logger | None = None)[source]
Bases:
objectClient for interacting with the Ayla IoT cloud platform. Manages authentication (access and refresh tokens) and device discovery.
- create_datapoint(dsn: str, name: str, value) dict[source]
Write one datapoint via the cloud channel — the app’s announce path.
Verified endpoint (
AylaProperty.createDatapointCloud/createDatapointEndpoint, Coffee Link 4.9.6; DECODED.md):POST apiv1/dsns/{dsn}/properties/{name}/datapoints.jsonwith{"datapoint": {"value": ...}}andx-ayla-source: Mobile. This is the channel that carriesdevice_connectedto the machine’s cloud uplink — independent of the LANlocal_regmodule, so it is the recovery lever when the LAN session is dead (research.md R17). Whether a wedged datapoint engine processes it is unverified — callers should treat it as a probe, not a fix.
- fetch_properties(dsn: str) dict[str, str | None][source]
Every datapoint of a device in ONE request —
{name: value}.This is the Coffee Link app’s property-store sync (
syncPropertiesfetch-all; research.md R11,captures/cloud_fetch.json). Values are the cloud’s last-published copies (protocol.md §13 staleness lesson) — fine for factory descriptors and menu order, not for a brew’s live recipe values.
- get_device(dsn: str, device_map_path: str | None = None)[source]
Retrieves a specific cloud device by its DSN.
- get_lan_config(dsn: str) dict[source]
Fetch LAN connectivity details for a device (FR-006).
Ported from
delonghi_coffee’sapi.get_lan_config— same Ayla platform, same account. Never raises just because LAN is disabled; returnslan_enabled: Falsewith the other fieldsNoneinstead (FR-008).
- get_serial_number(dsn: str) str | None[source]
Fetch the raw
d270_serialnumberproperty for a device.Used as an input to model detection (FR-004); returns
Noneif the property is absent rather than raising, so callers can safely fall through to the next detection tier.
- list_account_devices() list[dict][source]
Discover coffee-machine devices on the account (cloud-assisted onboarding).
Unlike
get_devices()(kept unchanged for backward compatibility), this re-fetches/devices.jsonand returns one enriched dict per coffee-machine device only — non-coffee appliances (e.g. a Pinguino A/C on the same account) are excluded, not just flagged (FR-002).