From ee1627a3a1aad639fc7c51b4966abd9771c7ee47 Mon Sep 17 00:00:00 2001 From: AAGaming Date: Wed, 14 Feb 2024 17:06:41 -0500 Subject: fix some broken types --- backend/decky_loader/wsrouter.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'backend/decky_loader/wsrouter.py') diff --git a/backend/decky_loader/wsrouter.py b/backend/decky_loader/wsrouter.py index fa0707f7..8b145dc3 100644 --- a/backend/decky_loader/wsrouter.py +++ b/backend/decky_loader/wsrouter.py @@ -1,4 +1,3 @@ -from _typeshed import DataclassInstance from logging import getLogger from asyncio import AbstractEventLoop, create_task @@ -27,8 +26,8 @@ class MessageType(IntEnum): # WSMessage with slightly better typings class WSMessageExtra(WSMessage): # TODO message typings here too - data: Any - type: WSMsgType + data: Any # type: ignore yes you can extend it + type: WSMsgType # type: ignore # see wsrouter.ts for typings @@ -133,7 +132,6 @@ class WSRouter: self.logger.debug('Firing frontend event %s with args %s', data) sent_data: Dict[Any, Any] | None = cast(Dict[Any, Any], data) if is_dataclass(data): - data_as_dataclass = cast(DataclassInstance, data) - sent_data = asdict(data_as_dataclass) + sent_data = asdict(data) # type: ignore Argument of type "DataclassInstance | type[DataclassInstance]" cannot be assigned to parameter "obj" of type "DataclassInstance" in function "asdict" await self.write({ "type": MessageType.EVENT.value, "event": event, "data": sent_data }) -- cgit v1.2.3