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, token_refresher: Callable[[], str] | None = None)[source]
Bases:
DeviceTransportA 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.
- 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.
- health() Any[source]
Returns the device’s online status as determined during initialization. This does not perform a live health check.
- pop_response() bytes | None[source]
Not available over the cloud API — the data_response mailbox is LAN-only.
- refresh_monitor() Any[source]
The cloud API does not provide a direct way to force a monitor refresh. This method is a no-op.
- request_property(name: str) Any[source]
Not available over the cloud API — refreshes happen on the device’s own republish cadence (native protocol features are LAN-only).
- send_command(command: str, alternative_property: str | None = None) 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.
- supports_mailbox = False
The cloud API has no response mailbox and cannot ask the device to republish a property; answers arrive as republished
dNNNproperties instead.Devicechecks these flags before usingpop_response/request_property.
- supports_property_requests = False
Submodules
- cremalink.transports.cloud.transport module
CloudTransportCloudTransport.command_mapCloudTransport.configure()CloudTransport.get_monitor()CloudTransport.get_properties()CloudTransport.get_property()CloudTransport.health()CloudTransport.pop_response()CloudTransport.property_mapCloudTransport.refresh_monitor()CloudTransport.request_property()CloudTransport.send_command()CloudTransport.set_mappings()CloudTransport.supports_mailboxCloudTransport.supports_property_requestsCloudTransport.write_property()
REQUEST_TIMEOUT