Class Plugins

This class implements the following methods and properties:

class lib.plugin.Plugins(smarthome, configfile)[source]

Bases: object

Plugin loader Class. Parses config file and creates a worker thread for each plugin

Parameters:
  • smarthome – Instance of the smarthome master-object
  • configfile (str) – Basename of the plugin configuration file
get_logic_parameters()[source]

Returns the list of all logic parameter definitions of all configured/loaded plugins

Returns:
static get_instance()[source]

Returns the instance of the Plugins class, to be used to access the plugin-api

Use it the following way to access the api:

from lib.plugin import Plugins
plugins = Plugins.get_instance()

# to access a method (eg. xxx()):
plugins.xxx()
Returns:logics instance
Return type:object of None
return_plugin(configname)[source]

Returns (the object of) one loaded smartplugin with given configname

Parameters:name (str) – name of the plugin to get
Returns:object of the plugin
Return type:object
return_plugins()[source]

Returns a list with the instances of all loaded plugins

Returns:list of plugin names
Return type:list
class PyObject[source]

Bases: _ctypes.Structure

refcnt

Structure/Union member

unload_plugin(configname)[source]

Unloads (the object of) one loaded plugin with given configname

Parameters:name (str) – name of the plugin to unload
Returns:success or failure
Return type:bool
start()[source]
stop()[source]
get_pluginthread(configname)[source]

Returns one plugin with given name

Returns:Thread object for the given plugin name
Return type:object