Skip to content

Transport

transport

Choosing between the LAN and the cloud to deliver commands.

Mirrors the app: when the box's local IP is known, commands go to <ip>:400 and fall back to the cloud if the box cannot be reached or refuses the frame. Otherwise they go through tmate20/feedthecommands + ack polling.

TransportMode

Bases: StrEnum

AUTO class-attribute instance-attribute

AUTO = 'auto'

CLOUD class-attribute instance-attribute

CLOUD = 'cloud'

LOCAL class-attribute instance-attribute

LOCAL = 'local'

Channel

Bases: StrEnum

LOCAL class-attribute instance-attribute

LOCAL = 'local'

CLOUD class-attribute instance-attribute

CLOUD = 'cloud'

SendResult dataclass

SendResult(channel: Channel, detail: str)

channel instance-attribute

channel: Channel

detail instance-attribute

detail: str

CommandSender

CommandSender(
    api: CloudApi,
    *,
    mode: TransportMode = AUTO,
    ack_timeout: float = 15.0,
)

Deliver commands to a Daisy box.

api instance-attribute

api = api

mode instance-attribute

mode = mode

ack_timeout instance-attribute

ack_timeout = ack_timeout

set_local_host

set_local_host(
    installation: Installation, host: str | None
) -> None

local_host

local_host(installation: Installation) -> str | None

send async

send(
    installation: Installation,
    commands: list[WireCommand],
    *,
    scenario_id: int = 0,
    cloud_only: bool = False,
    until: tuple[str, ...] = (ACK_PROCESSED, ACK_ACCEPTED),
) -> SendResult

Send device/scenario commands.

cloud_only is used for box-level commands (timers, schedule...), which the app always sends through the cloud and whose ack it waits for.