File: monitor.py

package info (click to toggle)
pyvlx 0.2.32-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,616 kB
  • sloc: python: 9,114; makefile: 53; sh: 5
file content (27 lines) | stat: -rw-r--r-- 603 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Just a demo of the new PyVLX module."""
import asyncio
import logging

from pyvlx import PyVLX


async def main() -> None:
    """Log packets from Bus."""
    # Setting debug
    logging.basicConfig(level=logging.DEBUG)

    # Connecting to KLF 200
    pyvlx = PyVLX('pyvlx.yaml')
    await pyvlx.load_scenes()
    await pyvlx.load_nodes()

    # and wait, increase this timeout if you want to
    # log for a longer time.:)
    await asyncio.sleep(90)

    # Cleanup, KLF 200 is terrible in handling lost connections
    await pyvlx.disconnect()


if __name__ == '__main__':
    asyncio.run(main())