File: all_devices.py

package info (click to toggle)
python-powerfox 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 680 kB
  • sloc: python: 581; makefile: 3
file content (20 lines) | stat: -rw-r--r-- 502 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
"""Asynchronous Python client for Powerfox."""

import asyncio

from powerfox import Powerfox


async def main() -> None:
    """Show example on getting Powerfox data."""
    async with Powerfox(username="EMAIL_ADDRESS", password="PASSWORD") as client:
        devices = await client.all_devices()
        print(devices)

        # How to show humand readable device type
        for device in devices:
            print(device.type.human_readable)


if __name__ == "__main__":
    asyncio.run(main())