fix: Configured PTZ actions should overrule auto-detected actions (not merge with them) (#1558)

* fix: Configured PTZ actions should overrule auto-detected actions (not merge with them)

* Don't populate capabilities unless there is some basis
This commit is contained in:
Dermot Duffy
2024-09-21 18:32:40 -07:00
committed by GitHub
parent 7fd6bc6bee
commit c225a9aeab
6 changed files with 31 additions and 30 deletions
+9 -7
View File
@@ -70,13 +70,15 @@ export const getPTZCapabilitiesFromCameraConfig = (
zoomOut?.length ||
presets?.length
? {
left: left ?? undefined,
right: right ?? undefined,
up: up ?? undefined,
down: down ?? undefined,
zoomIn: zoomIn ?? undefined,
zoomOut: zoomOut ?? undefined,
presets: presets,
// Only return keys with some capability (to aid with action merging
// later).
...(left ? { left } : {}),
...(right ? { right } : {}),
...(up ? { up } : {}),
...(down ? { down } : {}),
...(zoomIn ? { zoomIn } : {}),
...(zoomOut ? { zoomOut } : {}),
...(presets ? { presets } : {}),
}
: null;
};