pikvm/pikvm#1537: /hid/inactivity api

This commit is contained in:
Maxim Devaev
2025-06-10 02:49:50 +03:00
parent f25e5ef2b4
commit 735c2e6395
2 changed files with 16 additions and 3 deletions

View File

@@ -102,6 +102,11 @@ class HidApi:
await self.__hid.reset()
return make_json_response()
@exposed_http("GET", "/hid/inactivity")
async def __inactivity_handler(self, _: Request) -> Response:
secs = self.__hid.get_inactivity_seconds()
return make_json_response({"inactivity": secs})
# =====
async def get_keymaps(self) -> dict: # Ugly hack to generate hid_keymaps_state (see server.py)