NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Simplify on connect (#11176)
Nicolas Mowen90bdb0746398
diff --git a/frigate/comms/ws.py b/frigate/comms/ws.pyindex 65b2e8b1a6..fccd8db5c3 100644--- a/frigate/comms/ws.py+++ b/frigate/comms/ws.py@@ -50,10 +50,6 @@ class WebSocketClient(Communicator): # type: ignore[misc]class _WebSocketHandler(WebSocket): # type: ignore[misc]receiver = self._dispatcher- def opened(self) -> None:- """A new websocket is opened, we need to send an update message"""- threading.Timer(1.0, self.receiver, ("onConnect", "")).start()-def received_message(self, message: WebSocket.received_message) -> None:try:json_message = json.loads(message.data.decode("utf-8"))diff --git a/web/src/api/ws.tsx b/web/src/api/ws.tsxindex abe5c14b21..34fe4b2f08 100644--- a/web/src/api/ws.tsx+++ b/web/src/api/ws.tsx@@ -65,7 +65,13 @@ function useValue(): useValueReturn {setWsState({ ...wsState, [data.topic]: data.payload });}},- onOpen: () => {},+ onOpen: () => {+ sendJsonMessage({+ topic: "onConnect",+ message: "",+ retain: false,+ });+ },shouldReconnect: () => true,});