summaryrefslogtreecommitdiff
path: root/kvmd/htserver.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-07-19 17:02:26 +0300
committerMaxim Devaev <[email protected]>2022-07-19 17:02:26 +0300
commitc58cc99582c820b14bea7281b4b5b210ee720e8b (patch)
tree5954ce3b6da95b8387a5b403037907f0f9542bae /kvmd/htserver.py
parentadf4be9bf7c3b04fde04a6f3e516e48c5ea1a1e6 (diff)
lint fixes
Diffstat (limited to 'kvmd/htserver.py')
-rw-r--r--kvmd/htserver.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/kvmd/htserver.py b/kvmd/htserver.py
index 3a523b00..df687989 100644
--- a/kvmd/htserver.py
+++ b/kvmd/htserver.py
@@ -34,8 +34,10 @@ from typing import Dict
from typing import Callable
from typing import AsyncGenerator
from typing import Optional
+from typing import Union
from typing import Any
+from aiohttp import ClientWebSocketResponse
from aiohttp.web import BaseRequest
from aiohttp.web import Request
from aiohttp.web import Response
@@ -208,7 +210,12 @@ async def stream_json_exception(response: StreamResponse, err: Exception) -> Non
}, False)
-async def send_ws_event(wsr: WebSocketResponse, event_type: str, event: Optional[Dict]) -> None:
+async def send_ws_event(
+ wsr: Union[ClientWebSocketResponse, WebSocketResponse],
+ event_type: str,
+ event: Optional[Dict],
+) -> None:
+
await wsr.send_str(json.dumps({
"event_type": event_type,
"event": event,