thermostat/pytec/aioexample.py
atse b39e7dc015 Finish moving over to qasync
Also:

* Add aioclient

The old client is synchronous and blocking, and the only way to achieve
true asynchronous IO is to create a new client that interfaces with
asyncio.

* Finish Nix Flake description and make the GUI available for `nix run`
2024-10-21 18:26:28 +08:00

17 lines
446 B
Python

import asyncio
from pytec.aioclient import Client
async def main():
tec = Client()
await tec.connect() #(host="192.168.1.26", port=23)
await tec.set_param("s-h", 1, "t0", 20)
print(await tec.get_output())
print(await tec.get_pid())
print(await tec.get_output())
print(await tec.get_postfilter())
print(await tec.get_b_parameter())
async for data in tec.report_mode():
print(data)
asyncio.run(main())