Skip to content

TelecoHub

hub

High-level entry point: TelecoHub.

BoxInfo dataclass

BoxInfo(
    online: bool,
    net: NetParam | None,
    signal: str | None,
    current_time: str | None,
    firmware_version: str,
    raw: dict[str, str] = dict(),
)

What the cloud knows about a Daisy box (status of its own device).

online instance-attribute

online: bool

net instance-attribute

net: NetParam | None

signal instance-attribute

signal: str | None

current_time instance-attribute

current_time: str | None

firmware_version instance-attribute

firmware_version: str

raw class-attribute instance-attribute

raw: dict[str, str] = field(default_factory=dict)

InstallationData dataclass

InstallationData(
    installation: Installation,
    rooms: list[Room],
    devices: dict[int, Device],
    scenarios: list[Scenario],
)

installation instance-attribute

installation: Installation

rooms instance-attribute

rooms: list[Room]

devices instance-attribute

devices: dict[int, Device]

scenarios instance-attribute

scenarios: list[Scenario]

TelecoHub

TelecoHub(
    http: ClientSession,
    email: str,
    password: str,
    *,
    transport: TransportMode | str = AUTO,
    local_host: str | None = None,
    discover_local_ip: bool = True,
    base_url: str = BASE_URL,
    ack_timeout: float = 15.0,
)

Account-level access to Daisy installations, devices and scenarios.

>>> async with aiohttp.ClientSession() as http:
...     hub = TelecoHub(http, "me@example.com", "secret")
...     await hub.connect()
...     data = await hub.load(hub.installations[0])
...     slats = next(d for d in data.devices.values() if d.family == "slats")
...     await slats.set_position(66)

client instance-attribute

client = CloudClient(
    http, email, password, base_url=base_url
)

api instance-attribute

api = CloudApi(self.client)

sender instance-attribute

sender = CommandSender(
    self.api,
    mode=TransportMode(transport),
    ack_timeout=ack_timeout,
)

installations instance-attribute

installations: list[Installation] = []

data instance-attribute

data: dict[int, InstallationData] = {}

connect async

connect() -> list[Installation]

Log in and list the installations (boxes) of the account.

close async

close() -> None

installation

installation(key: int | str | None = None) -> Installation

Find an installation by id, instCode or description (default: first).

load async

load(installation: Installation) -> InstallationData

Fetch rooms, devices (with their commands) and scenarios.

devices

devices(
    installation: Installation | None = None,
) -> list[Device]

device

device(key: int | str) -> Device

Find a loaded device by id or label.

refresh async

refresh(installation: Installation) -> None

Refresh the status of every device of an installation.

box_info async

box_info(installation: Installation) -> BoxInfo

send_command async

send_command(
    device: Device, action: str, param: str
) -> SendResult

run_scenario async

run_scenario(
    installation: Installation, scenario: Scenario
) -> SendResult

save_scenario async

save_scenario(
    installation: Installation,
    *,
    description: str,
    steps: list[ScenarioStep],
    id_installation_scenario: int = 0,
    icon: int = 0,
    order: int = 0,
    id_installation_room: int = 0,
) -> Scenario

Create (id 0) or update a scenario in the cloud, then on the box.

Like SetupScenarioActivity: once the cloud has saved it, the box gets UP_SCEN with the scenario string, or DEL_SCEN if it has no step.

delete_scenario async

delete_scenario(
    installation: Installation, scenario: Scenario
) -> None

Delete a scenario from the cloud, then from the box (DEL_SCEN).

pair_remote async

pair_remote(
    installation: Installation, scenario: Scenario
) -> SendResult

Put the box in pairing mode for a remote bound to this scenario (PAIR_TX).

unpair_remote async

unpair_remote(
    installation: Installation, scenario: Scenario
) -> SendResult

Forget the remote bound to this scenario (UNPAIR_TX).

reset_remotes async

reset_remotes(
    installation: Installation, scenario: Scenario
) -> SendResult

Forget every remote bound to this scenario (RESET_TX).

send_remote_command async

send_remote_command(
    installation: Installation,
    action: str,
    param: str,
    id_installation_device: int,
) -> SendResult

Any remote pairing command (PAIR_TX, UNPAIR_TX, RESET_TX, PAIR_BUTTON, UNPAIR_BUTTON).

send_system async

send_system(
    installation: Installation, action: str, param: str = ""
) -> SendResult

Send any box-level command (GET_SIGNAL, GET_VERSION, SYNC_BOARD...) via the cloud.

query_box async

query_box(
    installation: Installation, action: str
) -> SendResult

Ask the box to refresh a status item: one of QUERY_ACTIONS (GET_TIME, GET_SIGNAL, GET_VERSION, GET_INFO, GET_DIAGNOSTIC).

request_feedback async

request_feedback(device: Device) -> SendResult

Ask the box for a device's feedback (GET_FEEDBACK).

read_ap_channel async

read_ap_channel(installation: Installation) -> SendResult

test_scan async

test_scan(installation: Installation) -> SendResult

TEST_SCAN (radio scan test of the box setup screen).

rename_installation async

rename_installation(
    installation: Installation, name: str
) -> None

Rename the installation in the cloud, then on the box (UP_INST_NAME).

update_device async

update_device(device: Device) -> SendResult | None

Push a device's options to the box (UP_DEV); only firmware >= 1.3.3.

set_ap_channel async

set_ap_channel(
    installation: Installation, *, static: bool
) -> SendResult

set_wifi async

set_wifi(
    installation: Installation, ssid: str, password: str
) -> SendResult

Change the Wi-Fi network the box joins (SET_WIFI).

set_box_time async

set_box_time(
    installation: Installation, value: str
) -> SendResult

update_firmware async

update_firmware(
    installation: Installation, url: str
) -> SendResult

Flash the box with the firmware at url (UPDATE_BOARD).

read_memory async

read_memory(
    installation: Installation, address: str, count: str
) -> SendResult

sync_box async

sync_box(installation: Installation) -> None

Re-send the whole configuration to the box (DaisyApplication#syncBoard).

SYNC_BOARD, UP_INST_NAME, UP_SCHED, then UP_DEV per device (firmware >= 1.3.3), UP_SCEN per scenario bound to a remote, UP_TIMERS per timer and END_SYNC; sent as isScenario batches of 30, each acked.

delete_room async

delete_room(installation: Installation, room: Room) -> None

Delete a room like SetupRoomsListActivity: cloud first, then the box.

The box forgets the timers of the room's devices (DEL_TIM), and scenarios that used those devices are re-sent without them (or deleted if now empty).

local_diagnostic async

local_diagnostic(installation: Installation) -> str

save_timer async

save_timer(device: Device, timer: Timer) -> list[Timer]

Create (id 0) or update one timer of a device, the way the app does.

delete_timer async

delete_timer(device: Device, id_timer: int) -> list[Timer]

Delete one timer of a device, the way the app does.

DEL_TIM is sent to the box and acked first; only then is the device's current cloud list saved back without that timer.

set_timer_active async

set_timer_active(
    device: Device, timer: Timer, active: bool
) -> list[Timer]

Enable or disable one timer (SetupTimerListActivity#timerActive).

Disabling on firmware >= 1.3.3 removes it from the box (DEL_TIM); otherwise the box gets UP_TIMERS with the new flag. The cloud list is saved after the ack.

set_timers_enabled async

set_timers_enabled(
    installation: Installation, enabled: bool
) -> None

Master switch of all the box timers (UP_SCHED, then installation-setup).