reolink: enable speed arg

This commit is contained in:
Koushik Dutta
2024-07-30 15:59:52 -07:00
parent 6fdd4bd0f4
commit 95906a9ed5
3 changed files with 10 additions and 10 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/reolink",
"version": "0.0.86",
"version": "0.0.87",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@scrypted/reolink",
"version": "0.0.86",
"version": "0.0.87",
"license": "Apache",
"dependencies": {
"@scrypted/common": "file:../../common",
@@ -24,18 +24,18 @@
"license": "ISC",
"dependencies": {
"@scrypted/sdk": "file:../sdk",
"@scrypted/server": "file:../server",
"http-auth-utils": "^5.0.1",
"typescript": "^5.3.3"
"typescript": "^5.5.3"
},
"devDependencies": {
"@types/node": "^20.11.0",
"monaco-editor": "^0.50.0",
"ts-node": "^10.9.2"
}
},
"../../sdk": {
"name": "@scrypted/sdk",
"version": "0.3.31",
"version": "0.3.45",
"dev": true,
"license": "ISC",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/reolink",
"version": "0.0.86",
"version": "0.0.87",
"description": "Reolink Plugin for Scrypted",
"author": "Scrypted",
"license": "Apache",

View File

@@ -201,7 +201,7 @@ export class ReolinkCameraClient {
return response.body?.[0]?.value?.DevInfo;
}
private async ptzOp(op: string) {
private async ptzOp(op: string, speed: number) {
const url = new URL(`http://${this.host}/api.cgi`);
const params = url.searchParams;
params.set('cmd', 'PtzCtrl');
@@ -223,7 +223,7 @@ export class ReolinkCameraClient {
param: {
channel: this.channelId,
op,
speed: 10,
speed,
timeout: 1,
}
},
@@ -260,7 +260,7 @@ export class ReolinkCameraClient {
op += 'Up';
if (op) {
await this.ptzOp(op);
await this.ptzOp(op, (command.speed?.pan || command.speed?.tilt || 1) * 10);
}
if (command.zoom < 0)
@@ -269,7 +269,7 @@ export class ReolinkCameraClient {
op = 'ZoomInc';
if (op) {
await this.ptzOp(op);
await this.ptzOp(op, (command.speed?.zoom || 1) * 10);
}
}