lce_service.device_class_api.core module

exception lce_service.device_class_api.core.DeviceClassInUseError(message: str, references: Dict[str, Any])

Bases: InvalidResourceError

Exception raised when a device class cannot be deleted because it is still referenced.

Parameters:
  • message – A descriptive error message naming the device class.

  • references – What still references the device class, with the number of devices and the Dynamic Applications aligned to it.

lce_service.device_class_api.core.get_device_class_identifier(dbc: silo_cursor, identifier: int | str, fuzzy: bool = True) → int

Resolve a device class identifier (an id, a GUID or a name) to the id of a device class.

Parameters:
  • dbc – A silo_cursor instance used to look up the device class.

  • identifier – The id, GUID (in either case) or name of the device class.

  • fuzzy – Whether a name without an exact match is matched approximately. Requests that change a device class pass False, so they only act on the device class named.

Returns:

The id of the device class.

Raises:
lce_service.device_class_api.core.invalidate_device_class_cache(dbc: silo_cursor) → None

Invalidate the platform’s cache of device classes, as its device class editor does.

Parameters:

dbc – A silo_cursor instance, within the transaction changing the device classes.

Raises:

DatabaseExecutionError – Raised when the database query fails.