1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
"""Asynchronous Python client for the Autarco API."""
import asyncio
from autarco import AccountSite, Autarco, Battery
async def main() -> None:
"""Show example on getting Autarco - battery data."""
async with Autarco(
email="test@autarco.com",
password="password",
) as client:
account_sites: list[AccountSite] = await client.get_account()
battery: Battery = await client.get_battery(account_sites[0].public_key)
print(battery)
if __name__ == "__main__":
asyncio.run(main())
|