-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathexample.py
More file actions
33 lines (26 loc) · 909 Bytes
/
Copy pathexample.py
File metadata and controls
33 lines (26 loc) · 909 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
"""Example usage of pyhaversion."""
import asyncio
import aiohttp
from pyhaversion import HaVersion
from pyhaversion.consts import HaVersionChannel, HaVersionSource
async def example() -> None:
"""Example usage of pyhaversion."""
async with aiohttp.ClientSession() as session:
sources = [
HaVersionSource.CONTAINER,
HaVersionSource.SUPERVISOR,
HaVersionSource.HAIO,
HaVersionSource.PYPI,
]
for source in sources:
version, data = await HaVersion(
session=session,
source=source,
board="generic-x86-64",
channel=HaVersionChannel.DEFAULT,
).get_version()
print(source)
print("Version:", version)
print("Version data:", data)
print()
asyncio.run(example())