File: device.py

package info (click to toggle)
python-gridnet 5.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 632 kB
  • sloc: python: 302; makefile: 8; sh: 5
file content (25 lines) | stat: -rw-r--r-- 662 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
# pylint: disable=W0621
"""Asynchronous Python client for a NET2GRID device."""

import asyncio

from gridnet import Device, GridNet


async def main() -> None:
    """Test device output."""
    async with GridNet(
        host="127.0.0.1",
    ) as gridnet:
        device: Device = await gridnet.device()
        print(device)
        print(f"ID: {device.n2g_id}")
        print(f"Model: {device.model}")
        print(f"Batch: {device.batch}")
        print(f"Firmware version: {device.firmware}")
        print(f"Hardware version: {device.hardware}")
        print(f"Manufacturer: {device.manufacturer}")


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