diff --git a/plugins/unifi-protect/package-lock.json b/plugins/unifi-protect/package-lock.json index d4e743311..320461e54 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.52", + "version": "0.0.53", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/unifi-protect", - "version": "0.0.52", + "version": "0.0.53", "license": "Apache", "dependencies": { "@scrypted/sdk": "file:../../sdk", diff --git a/plugins/unifi-protect/package.json b/plugins/unifi-protect/package.json index 6d5c947e5..c3a5390c8 100644 --- a/plugins/unifi-protect/package.json +++ b/plugins/unifi-protect/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/unifi-protect", - "version": "0.0.52", + "version": "0.0.53", "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 37ecdad3f..c4657d9a3 100644 --- a/plugins/unifi-protect/src/main.ts +++ b/plugins/unifi-protect/src/main.ts @@ -389,6 +389,11 @@ class UnifiProtect extends ScryptedDeviceBase implements Settings, DeviceProvide }; + debugLog(message: string, ...parameters: any[]) { + if (this.storage.getItem('debug')) + this.console.log(message, ...parameters); + } + async discoverDevices(duration: number) { const ip = this.getSetting('ip'); const username = this.getSetting('username'); @@ -412,7 +417,8 @@ class UnifiProtect extends ScryptedDeviceBase implements Settings, DeviceProvide } if (!this.api) { - this.api = new ProtectApi(() => { }, this.console, ip, username, password); + this.api = new ProtectApi((message, ...parameters) => + this.debugLog(message, ...parameters), this.console, ip, username, password); } try {