refactoring

This commit is contained in:
Devaev Maxim
2020-12-21 01:59:49 +03:00
parent 2cb210c975
commit 42475809fc
6 changed files with 43 additions and 65 deletions

View File

@@ -60,14 +60,9 @@ class MsdApi:
await self.__msd.set_params(**params) # type: ignore
return make_json_response()
@exposed_http("POST", "/msd/connect")
async def __connect_handler(self, _: Request) -> Response:
await self.__msd.connect()
return make_json_response()
@exposed_http("POST", "/msd/disconnect")
async def __disconnect_handler(self, _: Request) -> Response:
await self.__msd.disconnect()
@exposed_http("POST", "/msd/set_connected")
async def __set_connected_handler(self, request: Request) -> Response:
await self.__msd.set_connected(valid_bool(request.query.get("connected")))
return make_json_response()
@exposed_http("POST", "/msd/write")