From d7e2177eeb46aa92d184cb1d19d4e4ae2f9ed178 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Fri, 10 Sep 2021 12:16:03 -0700 Subject: [PATCH] unifi: dont sync isAdoptedByOther devices --- plugins/unifi-protect/package-lock.json | 4 ++-- plugins/unifi-protect/package.json | 2 +- plugins/unifi-protect/src/main.ts | 5 +++++ plugins/unifi-protect/src/unifi-protect | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/unifi-protect/package-lock.json b/plugins/unifi-protect/package-lock.json index 797631868..79de883cd 100644 --- a/plugins/unifi-protect/package-lock.json +++ b/plugins/unifi-protect/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/unifi-protect", - "version": "0.0.27", + "version": "0.0.29", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/unifi-protect", - "version": "0.0.27", + "version": "0.0.29", "license": "Apache", "dependencies": { "@types/ws": "^7.4.7", diff --git a/plugins/unifi-protect/package.json b/plugins/unifi-protect/package.json index bcc1712d7..c0f7f4da5 100644 --- a/plugins/unifi-protect/package.json +++ b/plugins/unifi-protect/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/unifi-protect", - "version": "0.0.27", + "version": "0.0.29", "description": "Unifi Protect Plugin for Scrypted", "author": "Scrypted", "license": "Apache", diff --git a/plugins/unifi-protect/src/main.ts b/plugins/unifi-protect/src/main.ts index d5b73e4c1..fe63c9c66 100644 --- a/plugins/unifi-protect/src/main.ts +++ b/plugins/unifi-protect/src/main.ts @@ -189,6 +189,11 @@ class UnifiProtect extends ScryptedDeviceBase implements Settings, DeviceProvide } for (let camera of this.api.Cameras) { + if (camera.isAdoptedByOther) { + this.console.log('skipping camera that is adopted by another nvr', camera.id, camera.name); + continue; + } + let needUpdate = false; for (const channel of camera.channels) { if (channel.idrInterval !== 4 || !channel.isRtspEnabled) { diff --git a/plugins/unifi-protect/src/unifi-protect b/plugins/unifi-protect/src/unifi-protect index f0e231201..2fc7fd26f 160000 --- a/plugins/unifi-protect/src/unifi-protect +++ b/plugins/unifi-protect/src/unifi-protect @@ -1 +1 @@ -Subproject commit f0e2312011c786e6bd5853fccac7f31aeaf9edd2 +Subproject commit 2fc7fd26fd78a2ec80ccdfe64bbba24a899ca8ae