diff --git a/plugins/reolink/package-lock.json b/plugins/reolink/package-lock.json index 1430e0ce9..a3b40e689 100644 --- a/plugins/reolink/package-lock.json +++ b/plugins/reolink/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/reolink", - "version": "0.0.95", + "version": "0.0.96", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/reolink", - "version": "0.0.95", + "version": "0.0.96", "license": "Apache", "dependencies": { "@scrypted/common": "file:../../common", diff --git a/plugins/reolink/package.json b/plugins/reolink/package.json index 21d208a36..c8ea0c420 100644 --- a/plugins/reolink/package.json +++ b/plugins/reolink/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/reolink", - "version": "0.0.95", + "version": "0.0.96", "description": "Reolink Plugin for Scrypted", "author": "Scrypted", "license": "Apache", diff --git a/plugins/reolink/src/reolink-api.ts b/plugins/reolink/src/reolink-api.ts index 7dc9b1b44..cc8ba1abc 100644 --- a/plugins/reolink/src/reolink-api.ts +++ b/plugins/reolink/src/reolink-api.ts @@ -249,6 +249,9 @@ export class ReolinkCameraClient { } async ptz(command: PanTiltZoomCommand) { + // reolink doesnt accept signed values to ptz + // in favor of explicit direction. + // so we need to convert the signed values to abs explicit direction. let op = ''; if (command.pan < 0) op += 'Left'; @@ -260,7 +263,7 @@ export class ReolinkCameraClient { op += 'Up'; if (op) { - await this.ptzOp(op, Math.round((command?.pan || command?.tilt || 1) * 10)); + await this.ptzOp(op, Math.round(Math.abs(command?.pan || command?.tilt || 1) * 10)); } op = undefined; @@ -270,7 +273,7 @@ export class ReolinkCameraClient { op = 'ZoomInc'; if (op) { - await this.ptzOp(op, Math.round((command?.zoom || 1) * 10)); + await this.ptzOp(op, Math.round(Math.abs(command?.zoom || 1) * 10)); } }