api refactoring

This commit is contained in:
Devaev Maxim
2019-03-27 06:57:43 +03:00
parent 68f28c69f3
commit 2acec3f229
5 changed files with 23 additions and 18 deletions

View File

@@ -443,6 +443,10 @@ class Server: # pylint: disable=too-many-instance-attributes
# ===== HID
@_exposed("GET", "/hid")
async def __hid_state_handler(self, _: aiohttp.web.Request) -> aiohttp.web.Response:
return _json(self.__hid.get_state())
@_exposed("POST", "/hid/reset")
async def __hid_reset_handler(self, _: aiohttp.web.Request) -> aiohttp.web.Response:
await self.__hid.reset()