1
0
forked from M-Labs/thermostat
thermostat/pytec/examples/aioexample.py

19 lines
461 B
Python
Raw Normal View History

import asyncio
from pytec.aioclient import AsyncioClient
2024-07-03 14:40:13 +08:00
async def main():
tec = AsyncioClient()
2024-08-22 12:58:52 +08:00
await tec.connect() # (host="192.168.1.26", port=23)
await tec.set_param("s-h", 1, "t0", 20)
print(await tec.get_pwm())
print(await tec.get_pid())
print(await tec.get_pwm())
print(await tec.get_postfilter())
print(await tec.get_steinhart_hart())
async for data in tec.report_mode():
print(data)
2024-07-03 14:40:13 +08:00
asyncio.run(main())