cremalink.transports.cloud package

This package contains the transport implementation for communicating with devices via the cloud.

It exposes the CloudTransport class as the main entry point.

class cremalink.transports.cloud.CloudTransport(dsn: str, access_token: str, device_map_path: str | None = None)[source]

Bases: DeviceTransport

A transport for communicating with a device via the cloud API.

This transport interacts directly with the Ayla cloud service endpoints, using a short-lived access token for authentication. Upon initialization, it fetches key device metadata from the cloud and stores it.

configure() None[source]

Configuration is handled during __init__, so this is a no-op.

get_monitor() Any[source]

Fetches, parses, and returns the device’s monitoring status.

This works by fetching the specific ‘monitor’ property, extracting its base64 value, and then decoding it into a structured snapshot.

get_properties() Any[source]

Fetches all properties for the device from the cloud API.

get_property(name: str) Any[source]

Fetches a single, specific property by name.

health() Any[source]

Returns the device’s online status as determined during initialization. This does not perform a live health check.

refresh_monitor() Any[source]

The cloud API does not provide a direct way to force a monitor refresh. This method is a no-op.

send_command(command: str) Any[source]

Sends a command to the device by creating a new ‘datapoint’ via the cloud API.

set_mappings(command_map: dict[str, Any], property_map: dict[str, Any]) None[source]

Stores the provided command and property maps on the instance.

Submodules