Class Plugins

This class implements the following methods and properties:

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

Bases: object

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

Parameter
  • smarthome – Instance of the smarthome master-object

  • configfile (str) – Basename of the plugin configuration file

get_logic_parameters()[Quellcode]

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

Rückgabe

static get_instance()[Quellcode]

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()
Rückgabe

logics instance

Rückgabetyp

object of None

return_plugin(configname)[Quellcode]

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

Parameter

name (str) – name of the plugin to get

Rückgabe

object of the plugin

Rückgabetyp

object

return_plugins()[Quellcode]

Returns a list with the instances of all loaded plugins

Rückgabe

list of plugin names

Rückgabetyp

list

class PyObject[Quellcode]

Bases: _ctypes.Structure

refcnt

Structure/Union member

unload_plugin(configname)[Quellcode]

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

Parameter

name (str) – name of the plugin to unload

Rückgabe

success or failure

Rückgabetyp

bool

start()[Quellcode]
stop()[Quellcode]
get_pluginthread(configname)[Quellcode]

Returns one plugin with given name

Rückgabe

Thread object for the given plugin name

Rückgabetyp

object