DeviceConfig#

class lsst.ts.ess.common.DeviceConfig(name, sens_type, baud_rate, location, dev_id=None, dev_type=None, num_channels=0, num_samples=0, safe_interval=0, threshold=0.0, host=None, port=None)#

Bases: object

Configuration for a device.

Parameters:
  • name (str) – The name of the device.

  • sens_type (SensorType) – The type of sensor.

  • baud_rate (int) – The baud rate of the sensor.

  • location (str) – The location of the device.

  • dev_type (DeviceType, optional) – The type of device, or None in case of a TCP/IP device.

  • dev_id (str) – The ID of the device, or None in case of a TCP/IP device.

  • num_channels (int, optional) – The number of channels the output data, or 0 indicating that the number of channels is not configurable for this type of device. Defaults to 0.

  • num_samples (int, optional) – The number of samples to accumulate before reporting telemetry. Only relevant for sensors that report statistics, such as anemometers. For those sensors the value must be > 1, and preferably larger. For other sensors use the default value of 0.

  • safe_interval (int, optional) – The number of seconds to sleep before an event is sent indicating that a previously sent event is over. Defaults to 0.

  • threshold (float, optional) – A threshold value that can be used to, for instance, determine if an event needs to be sent. Defaults to 0.0.

  • host (str, optional) – The host to connect to in case of a device that provides telemetry via a TCP/IP connection, or None in case of a local device.

  • port (int, optional) – The port to connect to in case of a device that provides telemetry via a TCP/IP connection, or None in case of a local device.

Notes

In case dev_type and dev_id are None then host and port cannot be None.

Attributes Summary

Methods Summary

as_dict()

Return a dict with the instance attributes and their values as key-value pairs.

Attributes Documentation

baud_rate: int = <dataclasses._MISSING_TYPE object>#
dev_id: str | None = None#
dev_type: DeviceType | None = None#
host: str | None = None#
location: str = <dataclasses._MISSING_TYPE object>#
name: str = <dataclasses._MISSING_TYPE object>#
num_channels: int = 0#
num_samples: int = 0#
port: int | None = None#
safe_interval: int = 0#
sens_type: SensorType = <dataclasses._MISSING_TYPE object>#
threshold: float = 0.0#

Methods Documentation

as_dict()#

Return a dict with the instance attributes and their values as key-value pairs.

Returns:

device_config_as_dict – A dictionary of key-value pairs representing the instance attributes and their values.

Return type:

dict