diff --git a/libs/lib/README.rst b/libs/lib/README.rst index 5b985eba0a1aba163c7a6a25efdb04b97d03bc5f..4babbf5d1a5409d8b45be3f21d5eb5b4958bb2d2 100644 --- a/libs/lib/README.rst +++ b/libs/lib/README.rst @@ -21,7 +21,7 @@ xaal.lib depends on : Install ~~~~~~~ Please refer to the official `full documentation to install the lib in a virtualenv -<https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7/README.html>`_ +<https://gitlab.imt-atlantique.fr/xaal/code/python/-/blob/main/README.rst>`_ Usage @@ -77,6 +77,23 @@ Let's take a look at a simple lamp device : eng.run() +To avoid to rewrite the same code for each device, you can use the xaal.schemas package. +This package provides a set of predefined devices, you can use them as a template to create your own device. + +.. code-block:: python + + from xaal.schemas import devices + from xaal.lib import Engine + + # create and configure the lamp device + dev = devices.lamp() + + # last step, create an engine and register the lamp + eng = Engine() + eng.add_device(dev) + eng.run() + + FAQ ~~~ The core engine run forever so how can I use it in webserver, GUI or to develop device