Skip to content

Commit d195dcf

Browse files
authored
Finish up the API (#2)
* Finish up the API * Add a no-op unit test for the client
1 parent 1ce784d commit d195dcf

8 files changed

Lines changed: 867 additions & 84 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ ENV/
7373
.vscode
7474

7575
.DS_Store
76+
priv/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ repos:
1717
rev: v1.15.0
1818
hooks:
1919
- id: mypy
20-
additional_dependencies: [aiohttp, yarl, pytest]
20+
additional_dependencies: [aiohttp, yarl, pytest, pydantic]

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ Async Python client for [NanoKVM](https://github.com/sipeed/NanoKVM).
77
```python
88

99
from aiohttp import ClientSession
10-
from nanokvm import ButtonType, NanoKVMClient
10+
from nanokvm.models import ButtonType
11+
from nanokvm.client import NanoKVMClient
1112

1213

1314
async with ClientSession() as session:
1415
client = NanoKVMClient("http://kvm-8b76.local/api/", session)
1516
await client.authenticate("username", "password")
1617

17-
hw_info = await client.get_hardware_info()
18-
dev_info = await client.get_device_info()
19-
gpio_state = await client.get_gpio_state()
18+
dev = await client.get_info()
19+
hw = await client.get_hardware()
20+
gpio = await client.get_gpio()
2021

21-
await client.send_keys("Hello\nworld!")
22+
await client.paste_text("Hello\nworld!")
2223

2324
async for frame in client.mjpeg_stream():
2425
print(frame)

nanokvm/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
from .client import ButtonType, NanoKVMClient
2-
3-
__all__ = ["ButtonType", "NanoKVMClient"]

0 commit comments

Comments
 (0)