PowerSwitchSimulator
- class ska_mid_cbf_mcs.power_switch.power_switch_simulator.PowerSwitchSimulator(model: str, logger: Logger)[source]
Bases:
object
A simulator for the power switch.
- Parameters:
model – Name of the power switch model
logger – a logger for this object to use
- property num_outlets: int
Get number of outlets present in this power switch.
- Returns:
number of outlets
- property is_communicating: bool
Returns whether or not the power switch can be communicated with.
- Returns:
simulator always returns True
- get_outlet_power_state(outlet: str) PowerState [source]
Get the power state of a specific outlet.
- Parameters:
outlet – outlet ID
- Returns:
power state of the outlet
- Raises:
AssertionError – if outlet ID is out of bounds
- turn_on_outlet(outlet: str) tuple[ska_control_model.result_code.ResultCode, str] [source]
Turn on a specific outlet.
- Parameters:
outlet – outlet ID to turn on
- Returns:
a tuple containing a return code and a string message indicating status
- Raises:
AssertionError – if outlet ID is out of bounds