reolink: add onvif two way option

This commit is contained in:
Koushik Dutta
2024-08-11 12:25:27 -07:00
parent 96dbb1776c
commit c6d8333402
3 changed files with 31 additions and 5 deletions

View File

@@ -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",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/reolink",
"version": "0.0.92",
"version": "0.0.93",
"description": "Reolink Plugin for Scrypted",
"author": "Scrypted",
"license": "Apache",

View File

@@ -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<Setting[]> {
return [
...await super.getRtspPortOverrideSettings(),
...await this.storageSettings.getSettings(),
];
}
getOtherSettings(): Promise<Setting[]> {
return this.storageSettings.getSettings();
}
getRtmpAddress() {
return `${this.getIPAddress()}:${this.storage.getItem('rtmpPort') || 1935}`;
}