Metadata-Version: 2.1
Name: xaal.monitor
Version: 0.4
Summary: xAAL devices Monitor Lib
Author-email: Jerome Kerdreux <Jerome.Kerdreux@imt-atlantique.fr>
License: GPL License
Project-URL: Homepage, https://recherche.imt-atlantique.fr/xaal/
Project-URL: Documentation, https://redmine.imt-atlantique.fr/projects/xaal/repository/xaal/entry/code/Python/branches/0.7/libs/monitor/README.rst
Project-URL: Source, https://redmine.imt-atlantique.fr/projects/xaal/repository/xaal/show/code/Python/branches/0.7/libs/monitor
Keywords: xaal,monitor
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Home Automation
Description-Content-Type: text/x-rst
Requires-Dist: xaal.lib

xaal.monitor
============
This package is a library for monitoring the xAAL devices on the network. It provides a easy way to get the list of devices and their status
(attributes, description, metadata, etc...). It also provides a simple way to subscribe to events.

This package is used by a lot of xAAL programs like: The dashboard, the REST API, the Home Assistant plugin...

Usage
-----
.. code:: python

    from xaal.monitor import Monitor
    from xaal.schemas import devices
    from xaal.lib import Engine

    def on_event(ev_type, device):
        print("Event type: %s from device %s" % (ev_type, device))

    dev = devices.hmi()
    eng = Engine()
    eng.add_device(dev)
    mon = Monitor(dev)
    mon.subscribe(on_event)
    eng.run()
