PowerSwitchComponentManager Class
- class ska_mid_cbf_tdc_mcs.power_switch.power_switch_component_manager.PowerSwitchComponentManager(*args: Any, **kwargs: Any)[source]
Bases:
CbfComponentManagerA component manager for the power switch. Calls either the power switch driver or the power switch simulator based on the value of simulation mode.
- Parameters:
model – Name of the power switch model
ip – IP address of the power switch
login – Login username of the power switch
password – Login password for the power switch
simulation_mode – simulation mode identifies if the real power switch driver or the simulator should be used
- 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:
whether the power switch is communicating
- 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
- is_turn_on_outlet_allowed() bool[source]
Check if the TurnOnOutlet command is allowed
- Returns:
True if the TurnOnOutlet command is allowed, False otherwise
- turn_on_outlet(argin: str, task_callback: Callable | None = None, **kwargs: any) tuple[ska_control_model.task_status.TaskStatus, str][source]
Turn on the PDU outlet specified by argin.
- Parameters:
argin – the target outlet ID, as a string
task_callback – callback to be called when the status of the command changes
- Returns:
a result code and message
- is_turn_off_outlet_allowed() bool[source]
Check if the TurnOffOutlet command is allowed
- Returns:
True if the TurnOffOutlet command is allowed, False otherwise
- turn_off_outlet(argin: str, task_callback: Callable | None = None, **kwargs: any) tuple[ska_control_model.task_status.TaskStatus, str][source]
Turn off the PDU outlet specified by argin.
- Parameters:
argin – the target outlet ID, as a string
task_callback – callback to be called when the status of the command changes
- Returns:
a result code and message