add detect fps, review, and audio messages

This commit is contained in:
Josh Hawkins 2026-03-29 11:14:54 -05:00
parent e42b6f75da
commit 78ea005724
4 changed files with 54 additions and 0 deletions

View File

@ -1606,5 +1606,16 @@
"onvif": {
"profileAuto": "Auto",
"profileLoading": "Loading profiles..."
},
"configMessages": {
"review": {
"recordDisabled": "Recording is disabled, review items will not be generated."
},
"audio": {
"noAudioRole": "No streams have the audio role defined. You must enable the audio role for audio detection to function."
},
"detect": {
"fpsGreaterThanFive": "Setting the detect FPS higher than 5 is not recommended."
}
}
}

View File

@ -3,6 +3,21 @@ import type { SectionConfigOverrides } from "./types";
const audio: SectionConfigOverrides = {
base: {
sectionDocs: "/configuration/audio_detectors",
messages: [
{
key: "no-audio-role",
messageKey: "configMessages.audio.noAudioRole",
severity: "warning",
condition: (ctx) => {
if (ctx.level === "camera" && ctx.fullCameraConfig) {
return !ctx.fullCameraConfig.ffmpeg?.inputs?.some((input) =>
input.roles?.includes("audio"),
);
}
return false;
},
},
],
restartRequired: [],
fieldOrder: [
"enabled",

View File

@ -3,6 +3,21 @@ import type { SectionConfigOverrides } from "./types";
const detect: SectionConfigOverrides = {
base: {
sectionDocs: "/configuration/camera_specific",
fieldMessages: [
{
key: "fps-greater-than-five",
field: "fps",
messageKey: "configMessages.detect.fpsGreaterThanFive",
severity: "info",
position: "after",
condition: (ctx) => {
if (ctx.level !== "camera" || !ctx.fullCameraConfig) return false;
const detectFps = ctx.formData?.fps as number | undefined;
const streamFps = ctx.fullCameraConfig.detect?.fps;
return detectFps != null && streamFps != null && detectFps > 5;
},
},
],
fieldOrder: [
"enabled",
"width",

View File

@ -3,6 +3,19 @@ import type { SectionConfigOverrides } from "./types";
const review: SectionConfigOverrides = {
base: {
sectionDocs: "/configuration/review",
messages: [
{
key: "record-disabled",
messageKey: "configMessages.review.recordDisabled",
severity: "warning",
condition: (ctx) => {
if (ctx.level === "camera" && ctx.fullCameraConfig) {
return ctx.fullCameraConfig.record.enabled === false;
}
return ctx.fullConfig.record?.enabled === false;
},
},
],
fieldDocs: {
"alerts.labels": "/configuration/review/#alerts-and-detections",
"detections.labels": "/configuration/review/#alerts-and-detections",