MockCommandHandler¶
- class lsst.ts.ess.common.MockCommandHandler(callback: Callable, simulation_mode: int)¶
Bases:
AbstractCommandHandler
Attributes Summary
Methods Summary
configure
(configuration)Apply the configuration and start sending telemetry.
create_device
(device_configuration)Create the device to connect to by using the specified configuration.
handle_command
(command, **kwargs)Handle incomming commands and parameters.
Stop reading the sensor data.
Attributes Documentation
- valid_simulation_modes = (0, 1)¶
Methods Documentation
- async configure(configuration: dict[str, Any]) None ¶
Apply the configuration and start sending telemetry.
- Parameters:
- configuration
dict
The contents of the dict depend on the type of sensor. See the ts_ess configuration schema for more details.
- configuration
- Raises:
CommandError
A CommandError with ResponseCode ALREADY_STARTED is raised if the command handler already was started.
- create_device(device_configuration: dict[str, Any]) BaseDevice ¶
Create the device to connect to by using the specified configuration.
- Parameters:
- device_configuration
dict
A dict representing the device to connect to. The format of the dict is described in the devices part of
lsst.ts.ess.common.CONFIG_SCHEMA
.
- device_configuration
- Returns:
- device
common.device.BaseDevice
The device to connect to.
- device
- Raises:
- RuntimeError
In case an incorrect configuration has been loaded.
- async handle_command(command: str, **kwargs: Any) None ¶
Handle incomming commands and parameters.
- Parameters:
- command
str
The command to handle.
- kwargs:
The parameters to the command.
- command
- async stop_sending_telemetry() None ¶
Stop reading the sensor data.
- Raises:
CommandError
A CommandError with ResponseCode NOT_STARTED is raised if the command handler was not started yet.