From bb52479640de07a28bbfe339053f22e94751c0bc Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 16 May 2024 09:28:01 -0500 Subject: [PATCH] get initial state --- web/src/api/ws.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/api/ws.tsx b/web/src/api/ws.tsx index ab3144ff6..831b3dff3 100644 --- a/web/src/api/ws.tsx +++ b/web/src/api/ws.tsx @@ -42,13 +42,17 @@ function useValue(): useValueReturn { const cameraStates: WsState = {}; Object.keys(config.cameras).forEach((camera) => { - const { name, record, detect, snapshots, audio } = config.cameras[camera]; + const { name, record, detect, snapshots, audio, onvif } = + config.cameras[camera]; cameraStates[`${name}/recordings/state`] = record.enabled ? "ON" : "OFF"; cameraStates[`${name}/detect/state`] = detect.enabled ? "ON" : "OFF"; cameraStates[`${name}/snapshots/state`] = snapshots.enabled ? "ON" : "OFF"; cameraStates[`${name}/audio/state`] = audio.enabled ? "ON" : "OFF"; + cameraStates[`${name}/ptz_autotracker/state`] = onvif.autotracking.enabled + ? "ON" + : "OFF"; }); setWsState({ ...wsState, ...cameraStates });