mirror of
https://github.com/koush/scrypted.git
synced 2026-06-26 19:30:25 +01:00
reolink: add onvif two way option
This commit is contained in:
4
plugins/reolink/package-lock.json
generated
4
plugins/reolink/package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/reolink",
|
||||
"version": "0.0.92",
|
||||
"version": "0.0.93",
|
||||
"description": "Reolink Plugin for Scrypted",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache",
|
||||
|
||||
@@ -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}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user