DeviceConfig

class lsst.ts.ess.common.DeviceConfig(name: str, dev_type: DeviceType, dev_id: str, sens_type: SensorType, baud_rate: int, location: str, num_channels: int = 0, num_samples: int = 0, safe_interval: int = 0, threshold: float = 0.0)

Bases: object

Configuration for a device.

Parameters
namestr

The name of the device.

dev_typeDeviceType

The type of device.

dev_idstr

The ID of the device.

sens_typeSensorType

The type of sensor.

baud_rateint

The baud rate of the sensor.

location: `str`

The location of the device.

num_channelsint, 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_samplesint, 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_intervalint, optional

The number of seconds to sleep before an event is sent indicating that a previously sent event is over. Defaults to 0.

thresholdfloat, optional

A threshold value that can be used to, for instance, determine if an event needs to be sent. Defaults to 0.0.

Attributes Summary

num_channels

num_samples

safe_interval

threshold

Methods Summary

as_dict()

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

Attributes Documentation

num_channels: int = 0
num_samples: int = 0
safe_interval: int = 0
threshold: float = 0.0

Methods Documentation

as_dict() dict[str, str | int]

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

Returns
device_config_as_dictdict

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