pikvm/pikvm#1485, pikvm/pikvm#187: kvmd-localhid to pass USB keyboard and mouse through PiKVM to the host

This commit is contained in:
Maxim Devaev
2025-05-23 23:44:59 +03:00
parent 625b2aa970
commit 310b23edad
11 changed files with 636 additions and 2 deletions

View File

@@ -237,9 +237,9 @@ class KvmdClientSession(BaseHttpClientSession):
self.switch = _SwitchApiPart(self._ensure_http_session)
@contextlib.asynccontextmanager
async def ws(self) -> AsyncGenerator[KvmdClientWs, None]:
async def ws(self, stream: bool=True) -> AsyncGenerator[KvmdClientWs, None]:
session = self._ensure_http_session()
async with session.ws_connect("/ws", params={"legacy": "0"}) as ws:
async with session.ws_connect("/ws", params={"stream": int(stream)}) as ws:
yield KvmdClientWs(ws)