File: example_climate.py

package info (click to toggle)
python-xknx 3.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,012 kB
  • sloc: python: 39,710; javascript: 8,556; makefile: 27; sh: 12
file content (20 lines) | stat: -rw-r--r-- 530 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Example for Climate device."""

import asyncio

from xknx import XKNX
from xknx.devices import Climate


async def main() -> None:
    """Connect to KNX/IP and read the state of a Climate device."""
    xknx = XKNX()
    async with xknx:
        climate = Climate(xknx, "TestClimate", group_address_temperature="6/2/1")
        xknx.devices.async_add(climate)
        await climate.sync(wait_for_result=True)
        # Will print out state of climate including current temperature:
        print(climate)


asyncio.run(main())