Skip to content

Commit

Permalink
change default event DataType
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 authored and marios8543 committed Nov 13, 2023
1 parent 5e1e035 commit 70532c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/decky_loader/wsrouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ async def handle(self, request: Request):
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 })

0 comments on commit 70532c8

Please sign in to comment.