powermon.ports.abstractport module¶
abstractport.py
- class powermon.ports.abstractport.AbstractPort(protocol: AbstractProtocol)¶
Bases:
ABC
base model for all ports
- async connect() bool ¶
default port connect function
- async disconnect() None ¶
default port disconnect function
- abstract async classmethod from_config(config: dict) AbstractPort ¶
build port object from config dict
- abstract is_connected() bool ¶
default is_connected function
- is_protocol_supported()¶
function to check if the protocol is supported by this port
- property protocol: AbstractProtocol¶
return the protocol associated with this port
- async run_command(command: Command) Result ¶
run_command takes a command object, runs the command and returns a result object (replaces process_command)
- abstract async send_and_receive(command: Command) Result ¶
main worker function for port objects, specific to each port type
- abstract to_dto() _AbstractPortDTO ¶
convert port object to data transfer object