mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 13:45:25 +03:00
get initial state
This commit is contained in:
parent
bbd3c0cba0
commit
bb52479640
@ -42,13 +42,17 @@ function useValue(): useValueReturn {
|
|||||||
const cameraStates: WsState = {};
|
const cameraStates: WsState = {};
|
||||||
|
|
||||||
Object.keys(config.cameras).forEach((camera) => {
|
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}/recordings/state`] = record.enabled ? "ON" : "OFF";
|
||||||
cameraStates[`${name}/detect/state`] = detect.enabled ? "ON" : "OFF";
|
cameraStates[`${name}/detect/state`] = detect.enabled ? "ON" : "OFF";
|
||||||
cameraStates[`${name}/snapshots/state`] = snapshots.enabled
|
cameraStates[`${name}/snapshots/state`] = snapshots.enabled
|
||||||
? "ON"
|
? "ON"
|
||||||
: "OFF";
|
: "OFF";
|
||||||
cameraStates[`${name}/audio/state`] = audio.enabled ? "ON" : "OFF";
|
cameraStates[`${name}/audio/state`] = audio.enabled ? "ON" : "OFF";
|
||||||
|
cameraStates[`${name}/ptz_autotracker/state`] = onvif.autotracking.enabled
|
||||||
|
? "ON"
|
||||||
|
: "OFF";
|
||||||
});
|
});
|
||||||
|
|
||||||
setWsState({ ...wsState, ...cameraStates });
|
setWsState({ ...wsState, ...cameraStates });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user