common component interface

This commit is contained in:
Devaev Maxim
2020-06-06 06:29:29 +03:00
parent 4f3ebf0fd1
commit 1d7d4100a5
7 changed files with 60 additions and 53 deletions

View File

@@ -41,7 +41,7 @@ class AtxApi:
@exposed_http("GET", "/atx")
async def __state_handler(self, _: Request) -> Response:
return make_json_response(self.__atx.get_state())
return make_json_response(await self.__atx.get_state())
@exposed_http("POST", "/atx/power")
async def __power_handler(self, request: Request) -> Response:

View File

@@ -38,7 +38,7 @@ class WolApi:
@exposed_http("GET", "/wol")
async def __state_handler(self, _: Request) -> Response:
return make_json_response(self.__wol.get_state())
return make_json_response(await self.__wol.get_state())
@exposed_http("POST", "/wol/wakeup")
async def __wakeup_handler(self, _: Request) -> Response: