From 797ef7908086aff0245571ac9f4c06aefc8b4b34 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Wed, 11 Sep 2024 09:28:10 -0700 Subject: [PATCH] unifi-protect: filter out unadopted cams --- plugins/unifi-protect/.vscode/settings.json | 2 +- plugins/unifi-protect/package-lock.json | 4 ++-- plugins/unifi-protect/package.json | 2 +- plugins/unifi-protect/src/main.ts | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/unifi-protect/.vscode/settings.json b/plugins/unifi-protect/.vscode/settings.json index 77ccdbd6d..a620593fa 100644 --- a/plugins/unifi-protect/.vscode/settings.json +++ b/plugins/unifi-protect/.vscode/settings.json @@ -1,4 +1,4 @@ { - "scrypted.debugHost": "127.0.0.1", + "scrypted.debugHost": "scrypted-nvr", } \ No newline at end of file diff --git a/plugins/unifi-protect/package-lock.json b/plugins/unifi-protect/package-lock.json index 7bc078d1e..424c704d7 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.154", + "version": "0.0.155", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/unifi-protect", - "version": "0.0.154", + "version": "0.0.155", "license": "Apache", "dependencies": { "@koush/unifi-protect": "file:../../external/unifi-protect", diff --git a/plugins/unifi-protect/package.json b/plugins/unifi-protect/package.json index 4fdf698f2..0ed2eb738 100644 --- a/plugins/unifi-protect/package.json +++ b/plugins/unifi-protect/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/unifi-protect", - "version": "0.0.154", + "version": "0.0.155", "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 74fdb50e5..25ed0ee42 100644 --- a/plugins/unifi-protect/src/main.ts +++ b/plugins/unifi-protect/src/main.ts @@ -321,6 +321,10 @@ export class UnifiProtect extends ScryptedDeviceBase implements Settings, Device this.console.log('skipping camera that is adopted by another nvr', camera.id, camera.name); continue; } + if (!camera.isAdopted) { + this.console.log('skipping camera that is not adopted', camera.id, camera.name); + continue; + } let needUpdate = false; for (const channel of camera.channels) {