-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
34 lines (22 loc) · 715 Bytes
/
example.py
File metadata and controls
34 lines (22 loc) · 715 Bytes
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
"""
Copyright (c) 2017-2018 Pascal Osinga
Licensed under MIT. All rights reserved.
"""
import asyncio
import aiohttp
from zeversolar_api import Zeversolar
HOST = 'www.zevercloud.com'
async def main():
"""The main part of the example script."""
async with aiohttp.ClientSession() as session:
data = Zeversolar(loop, session)
# Get the metrics for the sid
await data.get_sid('sid')
# Print the values
print("ID values:", data.values)
# Get the metrics about the E-Today
await data.get_E-Today('E-Today')
# Print the values
print("E-Today values:", data.values)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())