Device manager

class app.src.device_manager.DeviceManager

Bases: object

Manages devices in the application.

end()

Terminates all existing devices.

get_device(device_id: str) app.src.utils.abstract_device.Connector

Get an existing device reference.

Parameters

device_id – ID of the device

Returns

the requested device

new_device(config: dict) app.src.utils.abstract_device.Connector

Creates a new device in the application.

Extra parameters:

  • ‘device_id’: string - unique ID of the device,

  • ‘device_class’: string - Class of the device,

  • ‘device_type’: string - Type of the device,

  • ‘address’: string - Address on which the connection to the device can be established,

Parameters

config – Configuration of the device with the specified extra parameters

Returns

the created device

ping() Dict[str, bool]

Tests connectivity with each existing device.

Returns

A dictionary {“device_id”: true/false}

remove_device(device_id: str)

Terminates an existing device.

Parameters

device_id – ID of the device