change default event DataType

This commit is contained in:
AAGaming
2023-11-10 16:57:50 -05:00
committed by marios8543
parent 5e1e035bc2
commit 70532c8d0b
+3 -2
View File
@@ -132,7 +132,8 @@ class WSRouter:
self.logger.debug('Websocket connection closed')
return ws
async def emit(self, event: str, data: DataType | None = None, data_type: Type[DataType] = Any):
# DataType defaults to None so that if a plugin opts in to strict pyright checking and attempts to pass data witbout specifying the type (or any), the type check fails
async def emit(self, event: str, data: DataType | None = None, data_type: Type[DataType] = None):
self.logger.debug('Firing frontend event %s with args %s', data)
await self.write({ "type": MessageType.EVENT.value, "event": event, "data": data })
await self.write({ "type": MessageType.EVENT.value, "event": event, "data": data })