homebridge-unifi-protect 6.2.4 → 6.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,8 +35,8 @@ export declare const featureOptions: {
|
|
|
35
35
|
export interface FeatureOption {
|
|
36
36
|
default: boolean;
|
|
37
37
|
description: string;
|
|
38
|
-
hasFeature?: string;
|
|
39
|
-
hasProperty?: string;
|
|
38
|
+
hasFeature?: string[];
|
|
39
|
+
hasProperty?: string[];
|
|
40
40
|
name: string;
|
|
41
41
|
}
|
|
42
42
|
export declare function optionEnabled(configOptions: string[], nvrUfp: ProtectNvrConfig | null, device: ProtectDeviceConfigTypes | ProtectNvrConfig | null, option?: string, defaultReturnValue?: boolean, address?: string, addressOnly?: boolean): boolean;
|
package/dist/protect-options.js
CHANGED
|
@@ -3,7 +3,7 @@ export const featureOptionCategories = [
|
|
|
3
3
|
{ description: "Audio feature options.", name: "Audio", validFor: ["camera"] },
|
|
4
4
|
{ description: "Device feature options.", name: "Device", validFor: ["all"] },
|
|
5
5
|
{ description: "Doorbell feature options.", name: "Doorbell", validFor: ["camera"] },
|
|
6
|
-
{ description: "Logging feature options.", name: "Log", validFor: ["
|
|
6
|
+
{ description: "Logging feature options.", name: "Log", validFor: ["camera", "light", "sensor"] },
|
|
7
7
|
{ description: "Motion detection feature options.", name: "Motion", validFor: ["camera", "light", "sensor"] },
|
|
8
8
|
{ description: "NVR feature options.", name: "Nvr", validFor: ["nvr"] },
|
|
9
9
|
{ description: "Security system feature options.", name: "SecuritySystem", validFor: ["nvr"] },
|
|
@@ -16,32 +16,32 @@ export const featureOptions = {
|
|
|
16
16
|
// Audio options.
|
|
17
17
|
"Audio": [
|
|
18
18
|
{ default: true, description: "Audio support.", name: "" },
|
|
19
|
-
{ default: false, description: "Audio filter for ambient noise suppression.", hasFeature: "hasMotionZones", name: "Filter.Noise" },
|
|
20
|
-
{ default: true, description: "Two-way audio support on supported cameras.", hasFeature: "hasSpeaker", name: "TwoWay" }
|
|
19
|
+
{ default: false, description: "Audio filter for ambient noise suppression.", hasFeature: ["hasMotionZones"], name: "Filter.Noise" },
|
|
20
|
+
{ default: true, description: "Two-way audio support on supported cameras.", hasFeature: ["hasSpeaker"], name: "TwoWay" }
|
|
21
21
|
],
|
|
22
22
|
// Device options.
|
|
23
23
|
"Device": [
|
|
24
24
|
{ default: true, description: "Make this device available in HomeKit.", name: "" },
|
|
25
|
-
{ default: false, description: "Enable the status LED for this device in HomeKit.", hasFeature: "ledSettings", name: "StatusLed" }
|
|
25
|
+
{ default: false, description: "Enable the status LED for this device in HomeKit.", hasFeature: ["ledSettings"], name: "StatusLed" }
|
|
26
26
|
],
|
|
27
27
|
// Doorbell options.
|
|
28
28
|
"Doorbell": [
|
|
29
|
-
{ default: true, description: "Enable the doorbell messages feature.", hasFeature: "isDoorbell", name: "Messages" },
|
|
30
|
-
{ default: true, description: "Use messages saved to the Protect NVR as message switches.", hasFeature: "isDoorbell", name: "Messages.FromDoorbell" },
|
|
31
|
-
{ default: false, description: "Add a switch accessory to trigger doorbell ring events on a Protect camera or doorbell.", hasFeature: "hasMotionZones", name: "Trigger" }
|
|
29
|
+
{ default: true, description: "Enable the doorbell messages feature.", hasFeature: ["isDoorbell"], name: "Messages" },
|
|
30
|
+
{ default: true, description: "Use messages saved to the Protect NVR as message switches.", hasFeature: ["isDoorbell"], name: "Messages.FromDoorbell" },
|
|
31
|
+
{ default: false, description: "Add a switch accessory to trigger doorbell ring events on a Protect camera or doorbell.", hasFeature: ["hasMotionZones"], name: "Trigger" }
|
|
32
32
|
],
|
|
33
33
|
// Logging options.
|
|
34
34
|
"Log": [
|
|
35
|
-
{ default: true, description: "Log HomeKit Secure Video recording events in Homebridge.", hasFeature: "hasMotionZones", name: "HKSV" },
|
|
36
|
-
{ default: true, description: "Log doorbell ring events in Homebridge.", hasFeature: "hasMotionZones", name: "Doorbell" },
|
|
37
|
-
{ default: false, description: "Log motion events in Homebridge.", hasProperty: "
|
|
35
|
+
{ default: true, description: "Log HomeKit Secure Video recording events in Homebridge.", hasFeature: ["hasMotionZones"], name: "HKSV" },
|
|
36
|
+
{ default: true, description: "Log doorbell ring events in Homebridge.", hasFeature: ["hasMotionZones"], name: "Doorbell" },
|
|
37
|
+
{ default: false, description: "Log motion events in Homebridge.", hasProperty: ["isMotionDetected", "isPirMotionDetected"], name: "Motion" }
|
|
38
38
|
],
|
|
39
39
|
// Motion options.
|
|
40
40
|
"Motion": [
|
|
41
|
-
{ default: false, description: "Use UniFi Protect smart motion detection for HomeKit motion events when on a supported device.", hasFeature: "hasSmartDetect", name: "SmartDetect" },
|
|
42
|
-
{ default: false, description: "Add contact sensor accessories for each smart motion object type that UniFi Protect supports.", hasFeature: "hasSmartDetect", name: "SmartDetect.ObjectSensors" },
|
|
43
|
-
{ default: false, description: "Add a switch accessory to activate or deactivate motion detection in HomeKit.", name: "Switch" },
|
|
44
|
-
{ default: false, description: "Add a switch accessory to manually trigger a motion detection event in HomeKit.", name: "Trigger" }
|
|
41
|
+
{ default: false, description: "Use UniFi Protect smart motion detection for HomeKit motion events when on a supported device.", hasFeature: ["hasSmartDetect"], name: "SmartDetect" },
|
|
42
|
+
{ default: false, description: "Add contact sensor accessories for each smart motion object type that UniFi Protect supports.", hasFeature: ["hasSmartDetect"], name: "SmartDetect.ObjectSensors" },
|
|
43
|
+
{ default: false, description: "Add a switch accessory to activate or deactivate motion detection in HomeKit.", hasProperty: ["isMotionDetected", "isPirMotionDetected"], name: "Switch" },
|
|
44
|
+
{ default: false, description: "Add a switch accessory to manually trigger a motion detection event in HomeKit.", hasProperty: ["isMotionDetected", "isPirMotionDetected"], name: "Trigger" }
|
|
45
45
|
],
|
|
46
46
|
// NVR options.
|
|
47
47
|
"Nvr": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protect-options.js","sourceRoot":"","sources":["../src/protect-options.ts"],"names":[],"mappings":"AAqCA,6BAA6B;AAC7B,MAAM,CAAC,MAAM,uBA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,GAAG,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;IACxC,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAExD,wFAAwF;IACxF,IAAG,aAAa,CAAC,OAAO,CAAC,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE;QAE1D,OAAO,IAAI,CAAC;KACb;IAED,yFAAyF;IACzF,IAAG,aAAa,CAAC,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE;QAE3D,OAAO,KAAK,CAAC;KACd;IAED,sDAAsD;IACtD,gHAAgH;IAChH,IAAG,CAAC,MAAM,EAAE;QAEV,OAAO,kBAAkB,CAAC;KAC3B;IAED,0DAA0D;IAC1D,IAAG,aAAa,CAAC,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;QAEnD,OAAO,IAAI,CAAC;KACb;IAED,2DAA2D;IAC3D,IAAG,aAAa,CAAC,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;QAEpD,OAAO,KAAK,CAAC;KACd;IAED,mEAAmE;IACnE,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
|
|
@@ -25,11 +25,14 @@
|
|
|
25
25
|
Enable
|
|
26
26
|
</button>
|
|
27
27
|
</div>
|
|
28
|
-
<div id="
|
|
28
|
+
<div id="pageOptions" class="mt-2" style="display: none;">
|
|
29
29
|
<div id="deviceInfo">
|
|
30
30
|
<table class="table table-sm table-borderless">
|
|
31
|
+
<tr class="align-center">
|
|
32
|
+
<td colspan="2" class="m-0 p-2 text-center font-weight-bold">Feature options are applied in prioritized order from lowest to highest:<br><i>Global options</i> (lowest) → <i>Protect controller options</i> → <i>Protect device options</i> (highest)</td>
|
|
33
|
+
</tr>
|
|
31
34
|
<tr class="align-top">
|
|
32
|
-
<td rowspan="
|
|
35
|
+
<td rowspan="3" class="w-25">
|
|
33
36
|
<table class="table table-sm table-bordered m-0 p-0">
|
|
34
37
|
<tr>
|
|
35
38
|
<td>
|
|
@@ -48,7 +51,7 @@
|
|
|
48
51
|
<td>
|
|
49
52
|
<table class="table table-sm table-borderless border-bottom m-0 p-0" id="deviceStatsTable" style="display: none;">
|
|
50
53
|
<tr>
|
|
51
|
-
<th style="width: 30
|
|
54
|
+
<th style="width: 30%;" class="m-0 p-0"><B>Model<B></th>
|
|
52
55
|
<th style="width: 25%;" class="m-0 p-0"><B>IP Address</B></th>
|
|
53
56
|
<th style="width: 20%;" class="m-0 p-0"><B>MAC Address</B></th>
|
|
54
57
|
<th style="width: 25%;" class="m-0 p-0"><B>Status</B></th>
|
|
@@ -63,7 +66,7 @@
|
|
|
63
66
|
</td>
|
|
64
67
|
</tr>
|
|
65
68
|
<tr>
|
|
66
|
-
<td id="configTable"
|
|
69
|
+
<td id="configTable" style="width: 100%;">
|
|
67
70
|
</td>
|
|
68
71
|
</tr>
|
|
69
72
|
</table>
|
|
@@ -220,7 +223,7 @@
|
|
|
220
223
|
|
|
221
224
|
// Hide the legacy UI.
|
|
222
225
|
document.getElementById("pageSupport").style.display = "none";
|
|
223
|
-
document.getElementById("
|
|
226
|
+
document.getElementById("pageOptions").style.display = "block";
|
|
224
227
|
|
|
225
228
|
// What we're going to do is display our global options, followed by the list of controllers the user has configured.
|
|
226
229
|
// We pre-select the first controller by default for the user as a starting point.
|
|
@@ -231,24 +234,24 @@
|
|
|
231
234
|
// Start with a clean slate.
|
|
232
235
|
controllersTable.innerHTML = "";
|
|
233
236
|
|
|
234
|
-
// Enumerate our global
|
|
237
|
+
// Enumerate our global options.
|
|
235
238
|
const trGlobal = document.createElement("tr");
|
|
236
239
|
|
|
237
|
-
// Create the cell for our global
|
|
240
|
+
// Create the cell for our global options.
|
|
238
241
|
const tdGlobal = document.createElement("td");
|
|
239
242
|
tdGlobal.classList.add("m-0", "p-0");
|
|
240
243
|
|
|
241
244
|
// Create our label target.
|
|
242
245
|
const globalLabel = document.createElement("label");
|
|
243
246
|
|
|
244
|
-
globalLabel.name = "UFP Global
|
|
245
|
-
globalLabel.appendChild(document.createTextNode("Global
|
|
247
|
+
globalLabel.name = "UFP Global Options";
|
|
248
|
+
globalLabel.appendChild(document.createTextNode("Global Options"));
|
|
246
249
|
globalLabel.style.cursor = "pointer";
|
|
247
250
|
globalLabel.classList.add("mx-0", "py-2", "p-0", "w-100");
|
|
248
251
|
|
|
249
252
|
globalLabel.addEventListener("click", event => showDevices(null));
|
|
250
253
|
|
|
251
|
-
// Add the global
|
|
254
|
+
// Add the global options label.
|
|
252
255
|
tdGlobal.appendChild(globalLabel);
|
|
253
256
|
tdGlobal.style.fontWeight = "bold";
|
|
254
257
|
|
|
@@ -322,13 +325,13 @@
|
|
|
322
325
|
homebridge.showSpinner();
|
|
323
326
|
|
|
324
327
|
// Make sure we highlight the selected controller so the user knows where we are.
|
|
325
|
-
controllerList.map(x => (x.name === (controller ? controller.address : "UFP Global
|
|
328
|
+
controllerList.map(x => (x.name === (controller ? controller.address : "UFP Global Options")) ?
|
|
326
329
|
x.parentElement.classList.add("bg-info", "text-white") : x.parentElement.classList.remove("bg-info", "text-white"));
|
|
327
330
|
|
|
328
331
|
const devicesTable = document.getElementById("devicesTable");
|
|
329
332
|
let ufpDevices = [];
|
|
330
333
|
|
|
331
|
-
// If we're not accessing global
|
|
334
|
+
// If we're not accessing global options, pull a list of devices attached to this controller.
|
|
332
335
|
if(controller) {
|
|
333
336
|
|
|
334
337
|
ufpDevices = await homebridge.request("/getDevices", { address: controller.address, password: controller.password, username: controller.username });
|
|
@@ -457,7 +460,7 @@
|
|
|
457
460
|
// Populate the device information info pane.
|
|
458
461
|
const ufpDevice = ufpDevices.find(x => x.id === deviceId);
|
|
459
462
|
|
|
460
|
-
// Ensure we have a controller or device. The only time this won't be the case is when we're looking at global
|
|
463
|
+
// Ensure we have a controller or device. The only time this won't be the case is when we're looking at global options.
|
|
461
464
|
if(ufpDevice) {
|
|
462
465
|
|
|
463
466
|
document.getElementById("device_model").innerHTML = ufpDevice.marketName ?? ufpDevice.type;
|
|
@@ -480,6 +483,7 @@
|
|
|
480
483
|
const ufpFeatures = await homebridge.request("/getOptions", { configOptions: configOptions, nvrUfp: ufpDevices[0], deviceUfp: ufpDevice });
|
|
481
484
|
const optionsDevice = ufpFeatures.options;
|
|
482
485
|
|
|
486
|
+
// Start with a clean slate.
|
|
483
487
|
let newConfigTableHtml = "";
|
|
484
488
|
configTable.innerHTML = "";
|
|
485
489
|
|
|
@@ -520,8 +524,8 @@
|
|
|
520
524
|
for(const option of optionsDevice[category.name]) {
|
|
521
525
|
|
|
522
526
|
// Only show feature options that are valid for this device.
|
|
523
|
-
if(ufpDevice && (ufpDevice.modelKey !== "nvr") && ((option.hasFeature && (!ufpDevice.featureFlags || !ufpDevice.featureFlags[
|
|
524
|
-
(option.hasProperty && !
|
|
527
|
+
if(ufpDevice && (ufpDevice.modelKey !== "nvr") && ((option.hasFeature && (!ufpDevice.featureFlags || !option.hasFeature.some(x => ufpDevice.featureFlags[x]))) ||
|
|
528
|
+
(option.hasProperty && !option.hasProperty.some(x => x in ufpDevice)))) {
|
|
525
529
|
|
|
526
530
|
continue;
|
|
527
531
|
}
|
|
@@ -641,7 +645,7 @@
|
|
|
641
645
|
document.getElementById("menuSettings").classList.add("btn-primary");
|
|
642
646
|
|
|
643
647
|
document.getElementById("pageSupport").style.display = "block";
|
|
644
|
-
document.getElementById("
|
|
648
|
+
document.getElementById("pageOptions").style.display = "none";
|
|
645
649
|
|
|
646
650
|
// All done. Let the user interact with us.
|
|
647
651
|
homebridge.hideSpinner();
|
|
@@ -662,7 +666,7 @@
|
|
|
662
666
|
document.getElementById("menuSettings").classList.remove("btn-primary");
|
|
663
667
|
|
|
664
668
|
document.getElementById("pageSupport").style.display = "none";
|
|
665
|
-
document.getElementById("
|
|
669
|
+
document.getElementById("pageOptions").style.display = "none";
|
|
666
670
|
|
|
667
671
|
homebridge.showSchemaForm();
|
|
668
672
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-unifi-protect",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.5",
|
|
4
4
|
"displayName": "Homebridge UniFi Protect",
|
|
5
5
|
"description": "Homebridge UniFi Protect plugin providing complete HomeKit integration for the UniFi Protect ecosystem with full support for most features including autoconfiguration, motion detection, multiple controllers, and realtime updates.",
|
|
6
6
|
"author": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@homebridge/plugin-ui-utils": "^0.0.19",
|
|
69
69
|
"ffmpeg-for-homebridge": "^0.1.4",
|
|
70
70
|
"mqtt": "4.3.7",
|
|
71
|
-
"unifi-protect": "^4.1.
|
|
71
|
+
"unifi-protect": "^4.1.1",
|
|
72
72
|
"ws": "^8.13.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|