Work on websockets and event files.

This commit is contained in:
Scott Idem
2023-03-31 16:26:07 -04:00
parent cff165d9d9
commit b369d00b3e

View File

@@ -71,10 +71,12 @@ class ConnectionManager:
async def connect(self, websocket: WebSocket): async def connect(self, websocket: WebSocket):
await websocket.accept() await websocket.accept()
log.info('WS connect')
self.active_connections.append(websocket) self.active_connections.append(websocket)
log.debug(self.active_connections) log.debug(self.active_connections)
def disconnect(self, websocket: WebSocket): def disconnect(self, websocket: WebSocket):
log.info('WS disconnect')
self.active_connections.remove(websocket) self.active_connections.remove(websocket)
@@ -100,7 +102,7 @@ class ConnectionManager:
await connection.send_text(message) await connection.send_text(message)
async def group(self, group_id: str, data: dict): async def group(self, group_id: str, data: dict):
log.setLevel(logging.DEBUG) log.setLevel(logging.INFO)
log.debug(locals()) log.debug(locals())
for connection in self.active_connections: for connection in self.active_connections: