Controllers are object generators that create controls for a server. Controls are a set of commands that can tell a server to switch itself off on the software level (before the outlets switch off its power). Controllers also have a data field that gets logged in the PluginLogger, enabling logging information from the servers.
When creating a new controller type you should extend the class controller.ControllerTemplate.ControllerTemplate.
The python file containing the class should be placed in the src/controllers package.
Here are the methods you should implement when writing a new Controller class:
Template for a control object that all other controls extend
Variables: | data – Holds a dict of the data from the control |
---|
To be implemented by the child, sets the control’s state
Parameters: | state (bool) – The state to set |
---|
Here is an example dummy outlet implementation
Here is an INI template file from a control to send ssh commands to a server, located at src/config/conf_controllers/SSHController.ini: