mirror of
https://github.com/koush/scrypted.git
synced 2026-06-11 13:20:30 +01:00
reolink: enable speed arg
This commit is contained in:
10
plugins/reolink/package-lock.json
generated
10
plugins/reolink/package-lock.json
generated
@@ -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": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/reolink",
|
||||
"version": "0.0.86",
|
||||
"version": "0.0.87",
|
||||
"description": "Reolink Plugin for Scrypted",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache",
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user