-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest_main.py
More file actions
58 lines (50 loc) · 2.08 KB
/
test_main.py
File metadata and controls
58 lines (50 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import asyncio
import aiohttp
from innova_controls.fan_speed import FanSpeed
from innova_controls.innova import Innova
async def main():
async with aiohttp.ClientSession() as session:
innova = Innova(session, "127.0.0.1:5000", None, None)
await innova.async_update()
print(f"Model: {innova.model}")
print(f"Ambient: {innova.ambient_temp}")
# await innova.set_temperature(19)
print(f"Temperature Step: {innova.temperature_step}")
print(f"Target: {innova.target_temperature}")
print(f"Water Temp: {innova.water_temp}")
print(f"Name: {innova.name}")
print(f"Current Mode: {innova.mode}")
print(f"Powered: {innova.power}")
print(f"Fan Speed: {innova.fan_speed.name}")
print(f"Rotation: {innova.rotation}")
print(f"Night Mode: {innova.night_mode}")
print(f"Scheduling Mode: {innova.scheduling_mode}")
print(f"Keyboard Locked: {innova.keyboard_locked}")
modes = []
for mode in innova.supported_modes:
if mode.is_cooling:
modes.append("COOL")
elif mode.is_heating:
modes.append("HEAT")
elif mode.is_dehumidifying:
modes.append("DRY")
elif mode.is_fan_only:
modes.append("FAN_ONLY")
elif mode.is_auto:
modes.append("HEAT_COOL")
print(modes)
print(innova.supported_fan_speeds)
await innova.set_scheduling_off()
await innova.async_update()
print(f"Scheduling Mode: {innova.scheduling_mode}")
if innova.supports_keyboard_lock:
await innova.lock_keyboard()
print(f"Keyboard Locked: {innova.keyboard_locked}")
await innova.unlock_keyboard()
print(f"Keyboard Locked: {innova.keyboard_locked}")
await innova.async_update()
print(f"Keyboard Locked: {innova.keyboard_locked}")
# await innova.set_fan_speed(FanSpeed.AUTO)
# print(innova.fan_speed)
loop = asyncio.new_event_loop()
loop.run_until_complete(main())