diff --git a/plugins/reolink/package-lock.json b/plugins/reolink/package-lock.json index 5a5d8b8b7..31128124b 100644 --- a/plugins/reolink/package-lock.json +++ b/plugins/reolink/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/reolink", - "version": "0.0.92", + "version": "0.0.93", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/reolink", - "version": "0.0.92", + "version": "0.0.93", "license": "Apache", "dependencies": { "@scrypted/common": "file:../../common", diff --git a/plugins/reolink/package.json b/plugins/reolink/package.json index 8c22285f7..4fbb50ef8 100644 --- a/plugins/reolink/package.json +++ b/plugins/reolink/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/reolink", - "version": "0.0.92", + "version": "0.0.93", "description": "Reolink Plugin for Scrypted", "author": "Scrypted", "license": "Apache", diff --git a/plugins/reolink/src/main.ts b/plugins/reolink/src/main.ts index 8aca7255c..262fa9978 100644 --- a/plugins/reolink/src/main.ts +++ b/plugins/reolink/src/main.ts @@ -81,6 +81,7 @@ class ReolinkCamera extends RtspSmartCamera implements Camera, DeviceProvider, R hide: true, }, ptz: { + subgroup: 'Advanced', title: 'PTZ Capabilities', choices: [ 'Pan', @@ -111,11 +112,28 @@ class ReolinkCamera extends RtspSmartCamera implements Camera, DeviceProvider, R ], defaultValue: 'Default', }, + useOnvifTwoWayAudio: { + subgroup: 'Advanced', + title: 'Use ONVIF for Two-Way Audio', + type: 'boolean', + }, }); constructor(nativeId: string, provider: RtspProvider) { super(nativeId, provider); + this.storageSettings.settings.useOnvifTwoWayAudio.onGet = async () => { + return { + hide: !!this.storageSettings.values.doorbell, + } + }; + + this.storageSettings.settings.ptz.onGet = async () => { + return { + hide: !!this.storageSettings.values.doorbell, + } + }; + this.updateDeviceInfo(); (async () => { this.updatePtzCaps(); @@ -226,11 +244,16 @@ class ReolinkCamera extends RtspSmartCamera implements Camera, DeviceProvider, R if (this.storageSettings.values.doorbell) { interfaces.push( ScryptedInterface.BinarySensor, - ScryptedInterface.Intercom ); type = ScryptedDeviceType.Doorbell; name = 'Reolink Doorbell'; } + if (this.storageSettings.values.doorbell || this.storageSettings.values.useOnvifTwoWayAudio) { + interfaces.push( + ScryptedInterface.Intercom + ); + } + if (this.storageSettings.values.ptz?.length) { interfaces.push(ScryptedInterface.PanTiltZoom); } @@ -640,10 +663,13 @@ class ReolinkCamera extends RtspSmartCamera implements Camera, DeviceProvider, R async getRtspPortOverrideSettings(): Promise { return [ ...await super.getRtspPortOverrideSettings(), - ...await this.storageSettings.getSettings(), ]; } + getOtherSettings(): Promise { + return this.storageSettings.getSettings(); + } + getRtmpAddress() { return `${this.getIPAddress()}:${this.storage.getItem('rtmpPort') || 1935}`; }