Skip to content

Commit

Permalink
Add example
Browse files Browse the repository at this point in the history
  • Loading branch information
gjohansson-ST committed Jul 5, 2024
1 parent 27683b4 commit b57f03e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Test file for Sensibo."""

from __future__ import annotations

import asyncio

import aiohttp

from pysensibo import SensiboClient


async def main(event_loop: asyncio.AbstractEventLoop) -> None:
"""Retrieve device information from Sensibo cloud."""
async with aiohttp.ClientSession(loop=event_loop) as session:
client = SensiboClient("API_KEY", session)
devices = await client.async_get_devices_data()
print(devices) # noqa: T201


loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))

0 comments on commit b57f03e

Please sign in to comment.