feat: Add out of the box support for Reolink PTZ (#1982)

- Closes: #1964
This commit is contained in:
Dermot Duffy authored and GitHub committed 2025-03-26 21:26:02 -07:00
1 parent f6bb8001e3
commit b5eee5878a
50 files changed
+953 -679

No files matched your search

+3 -3
View File
@@ -384,7 +384,7 @@ describe('MenuController', () => {
controller.handleAction(createInteractionActionEvent('tap'), tapActionConfig);
expect(handler).toBeCalledWith(
expect.objectContaining({
detail: { action: [action], config: tapActionConfig },
detail: { actions: [action], config: tapActionConfig },
}),
);
expect(controller.isExpanded()).toBeFalsy();
@@ -402,7 +402,7 @@ describe('MenuController', () => {
);
expect(handler).toBeCalledWith(
expect.objectContaining({
detail: { action: [action], config: tapActionConfig },
detail: { actions: [action], config: tapActionConfig },
}),
);
});
@@ -418,7 +418,7 @@ describe('MenuController', () => {
expect(handler).toBeCalledWith(
expect.objectContaining({
detail: { action: [action, action, action], config: tapActionConfigMulti },
detail: { actions: [action, action, action], config: tapActionConfigMulti },
}),
);
});
+16 -15
View File
@@ -6,6 +6,7 @@ import {
PTZControlsConfig,
ptzControlsConfigSchema,
} from '../../../src/config/schema/common/controls/ptz';
import { PTZMovementType } from '../../../src/types';
import { createCameraManager, createCapabilities, createStore } from '../../test-utils';
const createConfig = (config?: Partial<PTZControlsConfig>): PTZControlsConfig => {
@@ -122,14 +123,14 @@ describe('PTZController', () => {
const store = createStore([
{
cameraID: 'camera.office',
capabilities: new Capabilities({ ptz: { left: ['relative'] } }),
capabilities: new Capabilities({ ptz: { left: [PTZMovementType.Relative] } }),
},
]);
const cameraManager = createCameraManager(store);
vi.mocked(cameraManager).getCameraCapabilities.mockReturnValue(
createCapabilities({
ptz: {
left: ['relative'],
left: [PTZMovementType.Relative],
},
}),
);
@@ -158,12 +159,12 @@ describe('PTZController', () => {
cameraID: 'camera.office',
capabilities: new Capabilities({
ptz: {
left: ['relative'],
right: ['relative'],
up: ['relative'],
down: ['relative'],
zoomIn: ['relative'],
zoomOut: ['relative'],
left: [PTZMovementType.Relative],
right: [PTZMovementType.Relative],
up: [PTZMovementType.Relative],
down: [PTZMovementType.Relative],
zoomIn: [PTZMovementType.Relative],
zoomOut: [PTZMovementType.Relative],
},
}),
},
@@ -197,12 +198,12 @@ describe('PTZController', () => {
cameraID: 'camera.office',
capabilities: new Capabilities({
ptz: {
left: ['relative'],
right: ['relative'],
up: ['relative'],
down: ['relative'],
zoomIn: ['relative'],
zoomOut: ['relative'],
left: [PTZMovementType.Relative],
right: [PTZMovementType.Relative],
up: [PTZMovementType.Relative],
down: [PTZMovementType.Relative],
zoomIn: [PTZMovementType.Relative],
zoomOut: [PTZMovementType.Relative],
presets: ['door', 'window'],
},
}),
@@ -387,7 +388,7 @@ describe('PTZController', () => {
expect(handler).toBeCalledWith(
expect.objectContaining({
detail: {
action: action,
actions: action,
config: config,
},
}),
@@ -325,7 +325,7 @@ describe('StatusBarController', () => {
expect(handler).toBeCalledWith(
expect.objectContaining({
detail: { action: [action], config: tapActionConfig },
detail: { actions: [action], config: tapActionConfig },
}),
);
});