From edb967c633487c90846a6df69adb3842a91fd95c Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Thu, 24 Dec 2020 15:49:23 +0300 Subject: hid set_connected api --- kvmd/apps/kvmd/api/hid.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'kvmd/apps') diff --git a/kvmd/apps/kvmd/api/hid.py b/kvmd/apps/kvmd/api/hid.py index a988ab34..9c39ab20 100644 --- a/kvmd/apps/kvmd/api/hid.py +++ b/kvmd/apps/kvmd/api/hid.py @@ -79,6 +79,11 @@ class HidApi: self.__hid.set_mouse_output(valid_hid_mouse_output(request.query.get("output"))) return make_json_response() + @exposed_http("POST", "/hid/set_connected") + async def __set_connected_handler(self, request: Request) -> Response: + self.__hid.set_connected(valid_bool(request.query.get("connected"))) + return make_json_response() + @exposed_http("POST", "/hid/reset") async def __reset_handler(self, _: Request) -> Response: await self.__hid.reset() -- cgit v1.2.3