Skip to content
Snippets Groups Projects
Select Git revision
  • e0e983e9b646d1770fe0cea592032fbf63d186ba
  • main default protected
  • py2-backport
  • tags/release-0.5_final
  • tags/release-0.4_final
  • tags/release-0.4_r2
  • tags/release-0.3
7 results

monitor

Name Last commit Last update
..
tests
xaal
README.rst
pyproject.toml

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

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()