File: README.md

package info (click to toggle)
python-aiooncue 0.3.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 204 kB
  • sloc: python: 592; makefile: 79; sh: 2
file content (28 lines) | stat: -rwxr-xr-x 629 bytes parent folder | download
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
# aiooncue
Python API for Kohler Oncue

Example
```
import asyncio
import pprint

import aiohttp
from aiooncue import Oncue


async def main():
    websession = aiohttp.ClientSession()
    oncue = Oncue("username", "password", websession)
    await oncue.async_login()
    devices = await oncue.async_list_devices()
    for device in devices:
        serialnumber = device["serialnumber"]
        data = await oncue.async_device_details(serialnumber)
        pprint.pprint([serialnumber, data])
    await websession.close()


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
```