mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 07:35:27 +03:00
description websocket hook and dispatcher
This commit is contained in:
parent
0bd70e7695
commit
265d68752e
@ -140,6 +140,10 @@ class Dispatcher:
|
|||||||
event: Event = Event.get(Event.id == payload["id"])
|
event: Event = Event.get(Event.id == payload["id"])
|
||||||
event.data["description"] = payload["description"]
|
event.data["description"] = payload["description"]
|
||||||
event.save()
|
event.save()
|
||||||
|
self.publish(
|
||||||
|
"event_update",
|
||||||
|
json.dumps({"id": event.id, "description": event.data["description"]}),
|
||||||
|
)
|
||||||
elif topic == "onConnect":
|
elif topic == "onConnect":
|
||||||
camera_status = self.camera_activity.copy()
|
camera_status = self.camera_activity.copy()
|
||||||
|
|
||||||
|
|||||||
@ -321,3 +321,10 @@ export function useImproveContrast(camera: string): {
|
|||||||
);
|
);
|
||||||
return { payload: payload as ToggleableSetting, send };
|
return { payload: payload as ToggleableSetting, send };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function useEventUpdate(): { payload: string } {
|
||||||
|
const {
|
||||||
|
value: { payload },
|
||||||
|
} = useWs("event_update", "");
|
||||||
|
return useDeepMemo(JSON.parse(payload as string));
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user