TeslasuitDocumentation
APIs

TsDeviceManager

teslasuit_sdk.ts_device_manager.TsDeviceManager

Manages connection and disconnection events for TESLASUIT devices.

Subscribes to the C API device event callback on construction and maintains the list of currently connected TsDevice instances.

Properties#

devices#

type=list
List of currently connected TsDevice instances.


Methods#

__init__#

def __init__(lib):

Initialize the device manager and subscribe to device events.

Parameters

lib

Loaded TESLASUIT C API library object (CDLL or WinDLL).


wait_for_device_to_connect#

def wait_for_device_to_connect(number_of_devices_to_wait: int = 1) -> None:

Block until the specified number of devices have connected.

Parameters

number_of_devices_to_wait: int = 1

Minimum number of devices to wait for before returning. Defaults to 1.


get_or_wait_last_device_attached#

def get_or_wait_last_device_attached() -> TsDevice:

Return the most recently connected device, waiting for one if none are connected.

Returns: TsDevice

The last device that connected.