Skip to content

Commit

Permalink
Merge pull request #67 from andrey-git/examples
Browse files Browse the repository at this point in the history
Add test example file
  • Loading branch information
gjohansson-ST authored Jul 5, 2024
2 parents 27683b4 + 86af394 commit 775aa86
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,6 @@ target/

# Virtual environment
venv/
# Test purpose only
ferry_test.py

# Mypy cache
.mypy_cache

test.py
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 775aa86

Please sign in to comment.