diff --git a/web/src/api/ws.tsx b/web/src/api/ws.tsx index 27600993a..3e9c8c14f 100644 --- a/web/src/api/ws.tsx +++ b/web/src/api/ws.tsx @@ -44,7 +44,8 @@ function useValue(): useValueReturn { return; } - const cameraActivity: { [key: string]: object } = JSON.parse(activityValue); + const cameraActivity: { [key: string]: FrigateCameraState } = + JSON.parse(activityValue); if (Object.keys(cameraActivity).length === 0) { return; @@ -64,9 +65,7 @@ function useValue(): useValueReturn { autotracking, alerts, detections, - } = - // @ts-expect-error we know this is correct - state["config"]; + } = state["config"]; cameraStates[`${name}/recordings/state`] = record ? "ON" : "OFF"; cameraStates[`${name}/enabled/state`] = enabled ? "ON" : "OFF"; cameraStates[`${name}/detect/state`] = detect ? "ON" : "OFF"; diff --git a/web/src/types/ws.ts b/web/src/types/ws.ts index cdaee4def..3badd961d 100644 --- a/web/src/types/ws.ts +++ b/web/src/types/ws.ts @@ -54,6 +54,15 @@ export type ObjectType = { export interface FrigateCameraState { config: { enabled: boolean; + detect: boolean; + snapshots: boolean; + record: boolean; + audio: boolean; + notifications: boolean; + notifications_suspended: number; + autotracking: boolean; + alerts: boolean; + detections: boolean; }; motion: boolean; objects: ObjectType[];