qmi.instruments.aviosys.ippower
Instrument driver for IP Power relay unit.
Classes
|
Commands. |
|
QMI driver for the IP Power relay unit. |
|
Socket identifiers. |
|
Power state (on/off) for sockets. |
- class qmi.instruments.aviosys.ippower.PowerSocket(value)
Socket identifiers.
- class qmi.instruments.aviosys.ippower.Command(value)
Commands.
- class qmi.instruments.aviosys.ippower.PowerState(value)
Power state (on/off) for sockets.
- class qmi.instruments.aviosys.ippower.IPPower9850(context: QMI_Context, name: str, ipv4_address: str, username: str = 'admin', password: str = '12345678')
QMI driver for the IP Power relay unit.
- open() None
Open the device interface by issuing a HEAD request and check for a response.
- close() None
Close the device interface.
- get_idn() QMI_InstrumentIdentification
Retrieve the device identification.
The MAC address of the device is used as unique serial number. The version field holds the firmware version.
- get_all_states() Dict[PowerSocket, PowerState]
Retrieve the power state of all channels.
- get_state(channel: PowerSocket) PowerState
Retrieve the power state of a single specific channel.
- Parameters:
channel – power socket identifier.
- set_state(channel: PowerSocket, target_state: PowerState) bool
Set the power state for a single specified channel.
- Parameters:
channel – power socket identifier.
target_state – target state (on/off).
- Returns:
True if state was set successfully, False otherwise.
- set_states(target_states: Dict[PowerSocket, PowerState]) bool
Set the power state of multiple channels at once.
- Parameters:
target_states – mapping of channels to target states (on/off).
- Returns:
True if all states were set successfully, False otherwise.
- set_all_off() bool
Turn off all channels.
- Returns:
True if all states were set off successfully, False otherwise.
- set_all_on() bool
Turn on all channels.
- Returns:
True if all states were set on successfully, False otherwise.
- cycle(channel: PowerSocket, wait: int = 1, *, block: bool = False) bool
Cycle power.
For the specified channel the power is turned off and then, after wait seconds, turned back on.
Note: the device returns OK when the command is accepted, so an additional check is needed to see if the cycle is actually successful. If block is True the routine will block until it verifies that the power is back on. It will block for at most wait + ippower.TIMEOUT seconds.
- Parameters:
channel – power socket identifier.
wait – wait time in seconds.
block – block until power cycling is verified.
- Returns:
True if all channels cycled ok, False otherwise.
- force_unlock() None
Forcefully unlock the remote object.
This unlocks the object, regardless of who owns the lock. This allows you to unlock an object if the locking proxy has been destroyed without unlocking.
Use this with care.
Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.
- classmethod get_category() str | None
Return the optional name of the category this object belongs to.
A category name is a free-form string that has no special significance. Its purpose is to distinguish between groups of RPC objects that fulfill similar roles.
- get_name() str
Return the name of this object.
- Returns:
name attribute.
- get_signals() list[SignalDescription]
Return a list of signals that can be published by this object.
- Returns:
List consisting of qmi_signals attributes.
- is_locked() bool
Query if the remote object is locked.
Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.
- is_open() bool
Return True if the instrument is open (ready for interaction).
- lock(timeout: float = 0.0, lock_token: str | None = None) bool
Lock the remote object. If timeout is given, try every 0.1s within the given timeout value. The remote object can be locked with an optional custom lock token by giving a string into lock_token keyword argument.
If successful, this proxy is the only proxy that can invoke RPC methods on the remote object; other proxies will receive an “object is locked” response. The return value indicates if the lock was granted; a denied lock means the object was already locked by another proxy.
Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.
- release_rpc_object() None
Give a warning if the instrument is removed while still open.
- unlock(lock_token: str | None = None) bool
Unlock the remote object.
Without optional parameters, this is only allowed by the proxy that initially locked the object. By giving the lock token as an input parameter, the specific object locked by this token can be unlocked. The return value indicates if the unlocking was successful.
Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.