mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-02 09:02:15 +03:00
Save initial camera state to update when websocket connects (#11174)
* Send camera state to dispatcher * Fix logic * Cleanup * Send camera activitiy in on connect * Support reading initial camera state * Fix key * Formatting * Sorting
This commit is contained in:
@@ -50,6 +50,10 @@ 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"))
|
||||
|
||||
Reference in New Issue
Block a user