Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ ENV/
.vscode

.DS_Store
priv/
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ repos:
rev: v1.15.0
hooks:
- id: mypy
additional_dependencies: [aiohttp, yarl, pytest]
additional_dependencies: [aiohttp, yarl, pytest, pydantic]
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ Async Python client for [NanoKVM](https://github.com/sipeed/NanoKVM).
```python

from aiohttp import ClientSession
from nanokvm import ButtonType, NanoKVMClient
from nanokvm.models import ButtonType
from nanokvm.client import NanoKVMClient


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

hw_info = await client.get_hardware_info()
dev_info = await client.get_device_info()
gpio_state = await client.get_gpio_state()
dev = await client.get_info()
hw = await client.get_hardware()
gpio = await client.get_gpio()

await client.send_keys("Hello\nworld!")
await client.paste_text("Hello\nworld!")

async for frame in client.mjpeg_stream():
print(frame)
Expand Down
3 changes: 0 additions & 3 deletions nanokvm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
from .client import ButtonType, NanoKVMClient

__all__ = ["ButtonType", "NanoKVMClient"]
Loading
Loading