campbellcontrol package
Subpackages
- campbellcontrol.commands package
- Submodules
- campbellcontrol.commands.commands module
- campbellcontrol.commands.typing module
- Module contents
- campbellcontrol.connection package
- mqttconfig package
Submodules
campbellcontrol.control module
Module for sending commands and receiving responses from loggers.
- class campbellcontrol.control.CommandHandler(client: Connection)
Bases:
ABC
Interface class for command/response handling. Different MQTT client objects have different signatures for the “on_message” method that must be reduced down to a “topic” and “message” to be processed by the current command instance. There are also different invocations for sending/receiving a command, so multiple CommandHandler classes are needed.
- client: Connection
Handle to the broker connection client object.
- send_command(command: Command, *args, timeout: int = 20, **kwargs) CommandResponse | None
Invokes a given MQTT command and awaits the response until timeout is reached.
- Parameters:
command – The specified Campbell compatible command.
*args – Arguments to pass to the given command.
timeout – Time in seconds before the command aborts.
**kwargs – Keyword arguments passed to the command.
- Returns:
A CommandResponse dictionary if a response is received, otherwise None.
- class campbellcontrol.control.PahoCommandHandler(client: Connection)
Bases:
CommandHandler
Handler class for the generic PAHO based clients.
- class campbellcontrol.control.AWSCommandHandler(client: Connection)
Bases:
CommandHandler