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)[source]

Bases: object

Client for interacting with the Ayla IoT cloud platform. Manages authentication (access and refresh tokens) and device discovery.

get_device(dsn: str, device_map_path: dict | None = None)[source]

Retrieves a specific cloud device by its DSN.

Parameters:
  • dsn (str) – The Device Serial Number of the desired device.

  • device_map_path (dict | None) – Optional mapping for device properties.

Returns:

An instance of CloudDevice if found, otherwise None.

Return type:

CloudDevice | None

get_devices()[source]

Retrieves a list of Device Serial Numbers (DSNs) for all registered devices.

Returns:

A list of DSNs.

Return type:

list[str]

get_lan_config(dsn: str) → dict[source]

Fetch LAN connectivity details for a device (FR-006).

Ported from delonghi_coffee’s api.get_lan_config — same Ayla platform, same account. Never raises just because LAN is disabled; returns lan_enabled: False with the other fields None instead (FR-008).

get_serial_number(dsn: str) → str | None[source]

Fetch the raw d270_serialnumber property for a device.

Used as an input to model detection (FR-004); returns None if 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.json and 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).

Returns:

Each with dsn, product_name, oem_model, lan_enabled, connection_status.

Return type:

list[dict]

Submodules