From b3a0c098a844d2cd97fe36698bab934b3df596fe Mon Sep 17 00:00:00 2001 From: Christian Oelschlegel Date: Tue, 4 Feb 2025 21:38:12 +0100 Subject: [PATCH] ptz calib added --- README.md | 3 ++- io-package.json | 23 +++++++++++++++++++++++ main.js | 20 ++++++++++++++++++-- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e315bf8..aacf90f 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ sendTo("reolink.0",{action: "snap"}, function(result){ ### **WORK IN PROGRESS** * (oelison) update disk info * (oelison) uri enconding is switchable (helps sometimes by one special char) +* (oelison) #28 PTZ check added ### 1.1.2 (2024-09-14) * (oelison) [#22](https://github.com/aendue/ioBroker.reolink/issues/22) password with some more special chars works now @@ -166,7 +167,7 @@ sendTo("reolink.0",{action: "snap"}, function(result){ ## License MIT License -Copyright (c) 2024 Andy Grundt +Copyright (c) 2025 Andy Grundt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/io-package.json b/io-package.json index c22339a..c716e2e 100644 --- a/io-package.json +++ b/io-package.json @@ -1377,6 +1377,29 @@ "write": true } }, + { + "_id": "settings.ptzCheck", + "type": "state", + "common": { + "role": "state", + "name": { + "en": "PTZ check", + "de": "PTZ-Check", + "ru": "PTZ проверка", + "pt": "Verificação PTZ", + "nl": "PTZ-controle", + "fr": "Contrôle PTZ", + "it": "Controllo PTZ", + "es": "PTZ check", + "pl": "Kontrola PTZ", + "uk": "Перевірка ПТЗ", + "zh-cn": "PTZ 检查" + }, + "type": "boolean", + "read": true, + "write": true + } + }, { "_id": "settings.ptzGuardTimeout", "type": "state", diff --git a/main.js b/main.js index 06c06c7..14293fe 100644 --- a/main.js +++ b/main.js @@ -145,6 +145,7 @@ class ReoLinkCam extends utils.Adapter { this.subscribeStates("settings.playAlarm"); this.subscribeStates("settings.getDiscData"); this.subscribeStates("settings.ptzEnableGuard"); + this.subscribeStates("settings.ptzCheck"); this.subscribeStates("settings.ptzGuardTimeout"); this.subscribeStates("Command.Reboot"); } @@ -729,7 +730,7 @@ class ReoLinkCam extends utils.Adapter { } } async startZoomFocus(pos) { - const ptzCheckCmd = [ + const startZoomCmd = [ { cmd: "StartZoomFocus", action: 0, @@ -742,7 +743,19 @@ class ReoLinkCam extends utils.Adapter { }, }, ]; - this.sendCmd(ptzCheckCmd, "StartZoomFocus"); + this.sendCmd(startZoomCmd, "StartZoomFocus"); + } + async setPtzCheck() { + const ptzCheckCmd = [ + { + cmd: "PtzCheck", + action: 0, + param: { + channel: Number(this.config.cameraChannel), + }, + }, + ]; + this.sendCmd(ptzCheckCmd, "PtzCallibration"); } async setScheduledRecording(state) { if (state !== true && state !== false) { @@ -1285,6 +1298,9 @@ class ReoLinkCam extends utils.Adapter { if (propName === "ptzEnableGuard") { this.setPtzGuard(state.val); } + if (propName === "ptzCheck") { + this.setPtzCheck(); + } if (propName === "ptzGuardTimeout") { this.setPtzGuardTimeout(state.val); } diff --git a/package-lock.json b/package-lock.json index 4d43c67..217f8fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.1.2", "license": "MIT", "dependencies": { - "@iobroker/adapter-core": "^3.2.2", + "@iobroker/adapter-core": "^3.2.3", "axios": "^1.7.7", "base-64": "^1.0.0", "https": "^1.0.0" diff --git a/package.json b/package.json index 81f029d..3fcad65 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "node": ">=18.0.0" }, "dependencies": { - "@iobroker/adapter-core": "^3.2.2", + "@iobroker/adapter-core": "^3.2.3", "axios": "^1.7.7", "base-64": "^1.0.0", "https": "^1.0.0"