2020-11-20 18:39:45 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2021-01-02 22:42:56 +00:00
|
|
|
# SPDX-FileCopyrightText: 2020-2021 Andrius Štikonas <andrius@stikonas.eu>
|
2020-12-27 19:20:34 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
2020-11-20 18:39:45 +00:00
|
|
|
|
2020-11-20 19:14:44 +00:00
|
|
|
|
2020-11-20 18:39:45 +00:00
|
|
|
import asyncio
|
2020-11-21 10:48:09 +00:00
|
|
|
import datetime
|
2020-11-20 19:14:44 +00:00
|
|
|
import logging
|
2020-12-27 18:58:30 +00:00
|
|
|
import neohubapi.neohub as neohub
|
2020-11-20 19:14:44 +00:00
|
|
|
|
2020-12-27 18:58:30 +00:00
|
|
|
from neohubapi.enums import ScheduleFormat
|
2020-11-20 18:39:45 +00:00
|
|
|
|
2020-11-22 10:23:27 +00:00
|
|
|
|
2020-11-20 18:39:45 +00:00
|
|
|
async def run():
|
|
|
|
hub = neohub.NeoHub()
|
2020-11-20 23:39:20 +00:00
|
|
|
system = await hub.get_system()
|
2021-01-02 22:42:56 +00:00
|
|
|
hub_data, devices = await hub.get_live_data()
|
|
|
|
print("Thermostats:")
|
|
|
|
for device in devices['thermostats']:
|
2020-12-31 23:42:02 +00:00
|
|
|
print(f"Target temperature of {device.name}: {device.target_temperature}")
|
2020-12-20 22:58:04 +00:00
|
|
|
await device.identify()
|
2020-11-20 18:39:45 +00:00
|
|
|
|
2021-01-02 22:42:56 +00:00
|
|
|
print("Timeclocks:")
|
|
|
|
for device in devices['timeclocks']:
|
|
|
|
print(f"Timeclock {device.name}: {device.target_temperature}")
|
|
|
|
print(await hub.set_timer_hold(False, 1, [device]))
|
|
|
|
|
2020-12-31 23:42:02 +00:00
|
|
|
print(await hub.target_temperature_step)
|
2020-11-20 19:14:44 +00:00
|
|
|
|
2020-12-31 23:42:02 +00:00
|
|
|
|
2021-01-02 22:42:56 +00:00
|
|
|
def main():
|
|
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
asyncio.run(run())
|
|
|
|
|
|
|
|
if (__name__ == '__main__'):
|
|
|
|
main()
|