Base class of every EventGhost plugin written in Python.
The (localised) name of the plugin.
The (localised) description of the plugin.
Internally used house keeping data. Don’t try to manipulate this yourself.
Assign a class with text strings to this field to get them localised. For more information read the section about Internationalisation Support for Plugins.
Start/Enable the plugin.
If your plugin is loaded and enabled by the user, this method will be called from EventGhost. Plugins should start its operation now.
The plugin will also receive its parameters (if it has any) through this method. To make a plugin that has parameters, you will have to overwrite the Configure() method also.
Stop/Disable the plugin.
If the user disables the plugin, this method will be called. The plugin should from now on not trigger any events anymore, till it gets another call to its __start__() method.
Gets called, if the plugin is about to be closed.
Override this if you have to do some cleanup before your plugin gets unloaded.
This should be overridden in a subclass, if the plugin wants to have a configuration dialog.
When the plugin is freshly added by the user to the configuration tree there are no *args and you must therefore supply sufficient default arguments. If the plugin is reconfigured by the user, this method will be called with the same arguments as the __start__() method would receive.
Returns the label that should be displayed in the configuration tree with the current arguments.
The default method simply shows the plugin name. If you want to have a different behaviour, you can override it. This method gets called with the same parameters as the __start__() method.
Adds an eg.ActionBase subclass to this plugin.
The action will then be visible in the AddActionDialog of EventGhost for this plugin (except hidden is set to True).
Through the usage of the clsName, name and description parameters, you can add the same action class multiple times with different names and descriptions. You can then also use the value parameter, to assign some arbitrary data to the action, that the action can then query through its self.value attribute.
Adds a new sub-group to the AddActionDialog of EventGhost for this plugin.
This group will appear under the group of the plugin. To add actions to this group, store the returned object and call AddAction on it. You can also call AddGroup on the returned object to create even deeper nested sub-groups.
The new sub-group instance
Trigger an event.
If the plugin wants to trigger an event in EventGhost, it should call self.TriggerEvent with the event name as suffix parameter. It can also post optional additional data through the payload parameter.
Keep in mind, that an event generated through this method will also automatically be ended immediately. If the plugin wants to generate an event with a longer duration, it has to use TriggerEnduringEvent().
Trigger an enduring event.
Does nearly the same as TriggerEvent() but the event will not be ended immediately. This is used for devices that can have longer enduring events, like a remote, where you can press and hold a button.
The plugin has to call EndLastEvent() to end the event. The last event will also be ended, if another event will be generated through TriggerEvent() or TriggerEnduringEvent(). This will ensure, that only one event per plugin can be active at the same time.
End the last event that was generated through TriggerEnduringEvent().