update restart required fields for global sections

This commit is contained in:
Josh Hawkins
2026-03-04 10:57:05 -06:00
parent 4ba33184a3
commit 4560961166
9 changed files with 28 additions and 50 deletions
+16
View File
@@ -54,6 +54,19 @@ export const cameraUpdateTopicMap: Record<string, string> = {
ui: "ui",
};
// Sections where global config serves as the default for per-camera config.
// Global updates to these sections are fanned out to all cameras via wildcard.
export const globalCameraDefaultSections = new Set([
"detect",
"objects",
"motion",
"record",
"snapshots",
"review",
"audio",
"notifications",
]);
// ---------------------------------------------------------------------------
// buildOverrides — pure recursive diff of current vs stored config & defaults
// ---------------------------------------------------------------------------
@@ -476,6 +489,9 @@ export function prepareSectionSavePayload(opts: {
if (level === "camera" && cameraName) {
const topic = cameraUpdateTopicMap[sectionPath];
updateTopic = topic ? `config/cameras/${cameraName}/${topic}` : undefined;
} else if (globalCameraDefaultSections.has(sectionPath)) {
const topic = cameraUpdateTopicMap[sectionPath];
updateTopic = topic ? `config/cameras/*/${topic}` : `config/${sectionPath}`;
} else {
updateTopic = `config/${sectionPath}`;
}