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

- Closes: #1964
This commit is contained in:
Dermot Duffy
2025-03-26 21:26:02 -07:00
committed by GitHub
parent f6bb8001e3
commit b5eee5878a
50 changed files with 953 additions and 679 deletions
+4 -16
View File
@@ -55,7 +55,6 @@ import {
RecordingSegmentsQueryResultsMap,
ResultsMap,
} from './types.js';
import { getConfiguredPTZAction } from './utils/ptz.js';
import { sortMedia } from './utils/sort-media.js';
export class QueryClassifier {
@@ -789,23 +788,12 @@ export class CameraManager {
preset?: string;
},
): Promise<void> {
const cameraConfig = this._store.getCameraConfig(cameraID);
if (!cameraConfig) {
const camera = this._store.getCamera(cameraID);
if (!camera) {
return;
}
const configuredAction = getConfiguredPTZAction(cameraConfig, action, options);
if (configuredAction) {
return await this._api.getActionsManager().executeActions(configuredAction);
}
const hass = this._api.getHASSManager().getHASS();
const engine = this._store.getEngineForCameraID(cameraID);
if (!engine || !hass) {
return;
}
return await this._requestLimit.add(() =>
engine.executePTZAction(hass, cameraConfig, action, options),
await this._requestLimit.add(() =>
camera.executePTZAction(this._api.getActionsManager(), action, options),
);
}
}