diff options
author | Devaev Maxim <[email protected]> | 2019-09-24 00:03:31 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-09-24 00:03:31 +0300 |
commit | aee005787c1c1082e50224fc492409e49b60d389 (patch) | |
tree | e531c4a616df4ebde6c69988e5a7c1bc21bf28df /kvmd/apps | |
parent | 661828502e7f9e3b8afcdff8def9678937de97a9 (diff) |
preparing to otg
Diffstat (limited to 'kvmd/apps')
-rw-r--r-- | kvmd/apps/kvmd/server.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/kvmd/apps/kvmd/server.py b/kvmd/apps/kvmd/server.py index e3413683..311cb6fd 100644 --- a/kvmd/apps/kvmd/server.py +++ b/kvmd/apps/kvmd/server.py @@ -64,7 +64,6 @@ from ...validators.auth import valid_auth_token from ...validators.kvm import valid_atx_power_action from ...validators.kvm import valid_atx_button -from ...validators.kvm import valid_kvm_target from ...validators.kvm import valid_log_seek from ...validators.kvm import valid_stream_quality from ...validators.kvm import valid_stream_fps @@ -468,12 +467,12 @@ class Server: # pylint: disable=too-many-instance-attributes return _json(self.__msd.get_state()) @_exposed("POST", "/msd/connect") - async def __msd_connect_handler(self, request: aiohttp.web.Request) -> aiohttp.web.Response: - to = valid_kvm_target(request.query.get("to")) - return _json(await ({ - "kvm": self.__msd.connect_to_kvm, - "server": self.__msd.connect_to_server, - }[to])()) + async def __msd_connect_handler(self, _: aiohttp.web.Request) -> aiohttp.web.Response: + return _json(await self.__msd.connect()) + + @_exposed("POST", "/msd/disconnect") + async def __msd_disconnect_handler(self, _: aiohttp.web.Request) -> aiohttp.web.Response: + return _json(await self.__msd.disconnect()) @_exposed("POST", "/msd/write") async def __msd_write_handler(self, request: aiohttp.web.Request) -> aiohttp.web.Response: |