mirror of
https://github.com/koush/scrypted.git
synced 2026-09-18 01:30:39 +01:00
unifi-protect: make connecitonHost an options
This commit is contained in:
4
plugins/unifi-protect/package-lock.json
generated
4
plugins/unifi-protect/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/unifi-protect",
|
||||
"version": "0.0.138",
|
||||
"version": "0.0.139",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/unifi-protect",
|
||||
"version": "0.0.138",
|
||||
"version": "0.0.139",
|
||||
"license": "Apache",
|
||||
"dependencies": {
|
||||
"@koush/unifi-protect": "file:../../external/unifi-protect",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/unifi-protect",
|
||||
"version": "0.0.138",
|
||||
"version": "0.0.139",
|
||||
"description": "Unifi Protect Plugin for Scrypted",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache",
|
||||
|
||||
@@ -317,7 +317,8 @@ export class UnifiCamera extends ScryptedDeviceBase implements Notifier, Interco
|
||||
const rtspChannel = camera.channels.find(check => check.id.toString() === vso.id);
|
||||
|
||||
const { rtspAlias } = rtspChannel;
|
||||
const u = `rtsps://${this.protect.getSetting('ip')}:7441/${rtspAlias}`
|
||||
const ip = (this.protect.getSetting('useConnectionHost') !== 'false' && camera.connectionHost) || this.protect.getSetting('ip');
|
||||
const u = `rtsps://${ip}:7441/${rtspAlias}`
|
||||
|
||||
const data = Buffer.from(JSON.stringify({
|
||||
url: u,
|
||||
|
||||
@@ -562,6 +562,13 @@ export class UnifiProtect extends ScryptedDeviceBase implements Settings, Device
|
||||
placeholder: '192.168.1.100',
|
||||
value: this.getSetting('ip') || '',
|
||||
},
|
||||
{
|
||||
key: 'useConnectionHost',
|
||||
title: 'Use Connection Host',
|
||||
description: 'Uses the connection host to route to connect to the RTSP Stream, and is required for stacked UNVR configuraitons. Disabling this setting will always use the configured Unifi Protect IP for RTSP streaming.',
|
||||
type: 'boolean',
|
||||
value: this.getSetting('useConnectionHost') !== 'false',
|
||||
}
|
||||
];
|
||||
|
||||
if (!isInstanceableProviderModeEnabled()) {
|
||||
|
||||
Reference in New Issue
Block a user