-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (23 loc) · 830 Bytes
/
Copy pathmain.py
File metadata and controls
30 lines (23 loc) · 830 Bytes
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
29
30
"""Quick CLI to list available NanoKVM devices and test connectivity."""
from nanokvm import SerialConnection, VideoCapture
from nanokvm._logger import get_logger
logger = get_logger(__name__)
def main() -> None:
logger.info("=== Available Serial Ports ===")
ports = SerialConnection.list_ports()
if ports:
for p in ports:
logger.info(f" {p.device}: {p.description} [{p.hwid}]")
else:
logger.info(" (none found)")
logger.info("\n=== Available Video Devices ===")
devices = VideoCapture.list_devices()
if devices:
for d in devices:
logger.info(
f" Index {d['index']}: {d['width']}x{d['height']} @ {d['fps']}fps ({d['backend']})"
)
else:
logger.info(" (none found)")
if __name__ == "__main__":
main()