File: example_scene.py

package info (click to toggle)
python-xknx 3.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,044 kB
  • sloc: python: 40,087; javascript: 8,556; makefile: 32; sh: 12
file content (18 lines) | stat: -rw-r--r-- 396 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Example for switching a light on and off."""

import asyncio

from xknx import XKNX
from xknx.devices import Scene


async def main() -> None:
    """Connect to KNX/IP bus and run scene."""
    async with XKNX() as xknx:
        scene = Scene(xknx, name="Romantic", group_address="7/0/9", scene_number=23)
        xknx.devices.async_add(scene)

        await scene.run()


asyncio.run(main())