forked from sander1988/pyIndego
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_new_aio.py
86 lines (63 loc) · 2.73 KB
/
test_new_aio.py
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
"""test aio client."""
import asyncio
import inspect
import json
import logging
import aiohttp
from pyIndego import IndegoAsyncClient
from pyIndego.const import Methods
logging.basicConfig(level=logging.DEBUG)
_LOGGER = logging.getLogger(__name__)
_LOGGER.setLevel(logging.DEBUG)
async def main(config):
"""Test class of test aio."""
async with IndegoAsyncClient(**config) as indego:
# await indego.update_alerts()
# print("alerts: ", indego.alerts)
# print("alert count: ", indego.alerts_count)
# await indego.update_calendar()
# print("calendar: ", indego.calendar)
# print("next mow: ", indego.next_mows)
# await indego.update_config()
# print("config: ", indego.config)
# await indego.update_generic_data()
# print("generic data: ", indego.generic_data)
# await indego.update_last_completed_mow()
# print("last completed mow: ", indego.last_completed_mow)
# await indego.update_location()
# print("location: ", indego.location)
# print("next mows with tz: ", indego.next_mows_with_tz)
# await indego.update_network()
# print("network: ", indego.network)
# await indego.update_next_mow()
# print("next mow: ", indego.next_mow)
# await indego.update_operating_data()
# print("operating data: ", indego.operating_data)
await indego.update_predictive_calendar()
print("predictive calendar: ", indego.predictive_calendar)
await indego.update_predictive_schedule()
print("predictive schedule: ", indego.predictive_schedule)
# await indego.update_security()
# print("security: ", indego.security)
# await indego.update_setup()
# print("setup: ", indego.setup)
# await indego.update_state()
# print("state: ", indego.state)
# print("state description: ", indego.state_description)
# print("state description detail: ", indego.state_description_detail)
# await indego.update_updates_available()
# print("update available: ", indego.update_available)
# await indego.update_user()
# print("user: ", indego.user)
# while True:
# await indego.update_state(longpoll=True, longpoll_timeout=300)
# print("state: ", indego.state)
# print("state description: ", indego.state_description)
# print("state description detail: ", indego.state_description_detail)
if __name__ == "__main__":
with open("config.json", "r") as config_file:
config = json.load(config_file)
# config.pop("serial")
# config["username"] = "sdjbfajhbsdf"
loop = asyncio.get_event_loop()
loop.run_until_complete(main(config))