DeviceConfig

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

Bases: object

Configuration for a device.

Parameters:
namestr

The name of the device.

sens_typeSensorType

The type of sensor.

baud_rateint

The baud rate of the sensor.

location: `str`

The location of the device.

dev_typeDeviceType, optional

The type of device, or None in case of a TCP/IP device.

dev_idstr

The ID of the device, or None in case of a TCP/IP 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.

hoststr, 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.

portint, 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

dev_id

dev_type

host

num_channels

num_samples

port

safe_interval

threshold

Methods Summary

as_dict()

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

Attributes Documentation

dev_id: str | None = None
dev_type: DeviceType | None = None
host: str | None = None
num_channels: int = 0
num_samples: int = 0
port: int | None = None
safe_interval: int = 0
threshold: float = 0.0

Methods Documentation

as_dict() dict[str, str | int | float | None]

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.