File: test.py

package info (click to toggle)
pysensibo 1.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 480 kB
  • sloc: python: 677; makefile: 3
file content (21 lines) | stat: -rw-r--r-- 537 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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))