cremalink.transports.local package

This package contains the transport implementation for communicating with devices over the local network (LAN).

It exposes the LocalTransport class as the main entry point.

class cremalink.transports.local.LocalTransport(dsn: str, lan_key: str, device_ip: str | None, server_host: str = '127.0.0.1', server_port: int = 10280, device_scheme: str = 'http', auto_configure: bool = False, command_map: dict[str, Any] | None = None, property_map: dict[str, Any] | None = None)[source]

Bases: DeviceTransport

A transport for communicating with a device on the local network.

This transport does not connect to the device directly. Instead, it sends requests to a local proxy server (cremalink.local_server), which then forwards them to the coffee machine. This architecture simplifies direct device communication and authentication.

configure() None[source]

Configures the local proxy server with the device’s connection details. This must be called before other methods can be used.

get_monitor() Any[source]

Retrieves and parses the device’s monitoring data.

get_properties() PropertiesSnapshot[source]

Retrieves all device properties from the local proxy server.

get_property(name: str) Any[source]

Retrieves a single property value from the local proxy server.

health() str[source]

Checks the health of the local proxy server.

refresh_monitor() None[source]

Requests a refresh of the monitoring data via the local proxy server.

send_command(command: str) dict[str, Any][source]

Sends a command to the device via the local proxy server.

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

Sets the command and property maps and re-configures the server if needed. If the name of the monitoring property changes, the server is reconfigured.

Submodules