There are two ways to access the API
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.item import Items items = Items.get_instance() # to access a method (eg. to get the list of Items): items.return_items()
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. to get the list of Items): sh.items.return_items()
The API is implemented through the following module:
The API consists of two classes.
This class implements the item itself:
This class implements the loading and management of the items in form of the item-tree.