Plugins-API
There are two ways to access the API
Directly
Use it the following way to access the api, if you have no access to the sh object in your method or function:
# to get access to the object instance: from lib.plugin import Plugins plugins = plugins.get_instance() # to access a method (eg. return_plugins()): plugins.return_plugins()
This is the preferred method.
Through the main SmartHome object
If you have access to the sh object in your method or function, you can use the following way:
# to access a method (eg. return_plugins()): sh.plugins.return_plugins()
The API is implemented through the following module:
lib.plugin
The API consists of two classes.
class PluginWrapper
This class implements the Plugin itself:
class Plugins
This class implements the loading and management of the plugins.