mirror of
https://github.com/koush/scrypted.git
synced 2026-02-14 10:52:07 +00:00
reolink: use abs movement
This commit is contained in:
4
plugins/reolink/package-lock.json
generated
4
plugins/reolink/package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/reolink",
|
||||
"version": "0.0.95",
|
||||
"version": "0.0.96",
|
||||
"description": "Reolink Plugin for Scrypted",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache",
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user