homebridge-unifi-protect 5.5.2 → 6.0.0
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.
- package/README.md +3 -3
- package/config.schema.json +17 -16
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/protect-camera.d.ts +58 -0
- package/dist/protect-camera.js +367 -246
- package/dist/protect-camera.js.map +1 -1
- package/dist/protect-device.d.ts +48 -0
- package/dist/protect-device.js +189 -0
- package/dist/protect-device.js.map +1 -0
- package/dist/protect-doorbell.d.ts +22 -0
- package/dist/protect-doorbell.js +75 -64
- package/dist/protect-doorbell.js.map +1 -1
- package/dist/protect-ffmpeg-record.d.ts +15 -0
- package/dist/protect-ffmpeg-record.js +48 -34
- package/dist/protect-ffmpeg-record.js.map +1 -1
- package/dist/protect-ffmpeg-stream.d.ts +15 -0
- package/dist/protect-ffmpeg-stream.js +22 -12
- package/dist/protect-ffmpeg-stream.js.map +1 -1
- package/dist/protect-ffmpeg.d.ts +42 -0
- package/dist/protect-ffmpeg.js +49 -58
- package/dist/protect-ffmpeg.js.map +1 -1
- package/dist/protect-light.d.ts +13 -0
- package/dist/protect-light.js +63 -40
- package/dist/protect-light.js.map +1 -1
- package/dist/protect-liveviews.d.ts +17 -0
- package/dist/protect-liveviews.js +117 -101
- package/dist/protect-liveviews.js.map +1 -1
- package/dist/protect-mqtt.d.ts +19 -0
- package/dist/protect-mqtt.js +26 -35
- package/dist/protect-mqtt.js.map +1 -1
- package/dist/protect-nvr-events.d.ts +30 -0
- package/dist/protect-nvr-events.js +168 -431
- package/dist/protect-nvr-events.js.map +1 -1
- package/dist/protect-nvr-systeminfo.d.ts +15 -0
- package/dist/protect-nvr-systeminfo.js +43 -49
- package/dist/protect-nvr-systeminfo.js.map +1 -1
- package/dist/protect-nvr.d.ts +48 -0
- package/dist/protect-nvr.js +327 -359
- package/dist/protect-nvr.js.map +1 -1
- package/dist/protect-options.d.ts +39 -0
- package/dist/protect-options.js +172 -6
- package/dist/protect-options.js.map +1 -1
- package/dist/protect-platform.d.ts +17 -0
- package/dist/protect-platform.js +17 -30
- package/dist/protect-platform.js.map +1 -1
- package/dist/protect-record.d.ts +33 -0
- package/dist/protect-record.js +130 -126
- package/dist/protect-record.js.map +1 -1
- package/dist/protect-rtp.d.ts +29 -0
- package/dist/protect-rtp.js +133 -16
- package/dist/protect-rtp.js.map +1 -1
- package/dist/protect-securitysystem.d.ts +18 -0
- package/dist/protect-securitysystem.js +105 -109
- package/dist/protect-securitysystem.js.map +1 -1
- package/dist/protect-sensor.d.ts +28 -0
- package/dist/protect-sensor.js +79 -97
- package/dist/protect-sensor.js.map +1 -1
- package/dist/protect-stream.d.ts +41 -0
- package/dist/protect-stream.js +298 -156
- package/dist/protect-stream.js.map +1 -1
- package/dist/protect-timeshift.d.ts +30 -0
- package/dist/protect-timeshift.js +65 -48
- package/dist/protect-timeshift.js.map +1 -1
- package/dist/protect-types.d.ts +50 -0
- package/dist/protect-types.js +22 -0
- package/dist/protect-types.js.map +1 -0
- package/dist/protect-viewer.d.ts +17 -0
- package/dist/protect-viewer.js +41 -47
- package/dist/protect-viewer.js.map +1 -1
- package/dist/settings.d.ts +22 -0
- package/dist/settings.js +30 -35
- package/dist/settings.js.map +1 -1
- package/homebridge-ui/public/index.html +715 -0
- package/homebridge-ui/server.js +156 -0
- package/package.json +15 -16
- package/dist/protect-accessory.js +0 -184
- package/dist/protect-accessory.js.map +0 -1
package/dist/protect-mqtt.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const settings_1 = require("./settings");
|
|
9
|
-
class ProtectMqtt {
|
|
1
|
+
/* Copyright(C) 2017-2023, HJD (https://github.com/hjdhjd). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* protect-mqtt.ts: MQTT connectivity class for UniFi Protect.
|
|
4
|
+
*/
|
|
5
|
+
import mqtt from "mqtt";
|
|
6
|
+
import { PROTECT_MQTT_RECONNECT_INTERVAL } from "./settings.js";
|
|
7
|
+
export class ProtectMqtt {
|
|
10
8
|
constructor(nvr) {
|
|
11
9
|
this.config = nvr.config;
|
|
12
|
-
this.debug = nvr.platform.debug.bind(nvr.platform);
|
|
13
10
|
this.isConnected = false;
|
|
14
|
-
this.log = nvr.
|
|
11
|
+
this.log = nvr.log;
|
|
15
12
|
this.mqtt = null;
|
|
16
13
|
this.nvr = nvr;
|
|
17
|
-
this.
|
|
14
|
+
this.ufpApi = nvr.ufpApi;
|
|
18
15
|
this.subscriptions = {};
|
|
19
16
|
if (!this.config.mqttUrl) {
|
|
20
17
|
return;
|
|
@@ -25,16 +22,16 @@ class ProtectMqtt {
|
|
|
25
22
|
configure() {
|
|
26
23
|
// Try to connect to the MQTT broker and make sure we catch any URL errors.
|
|
27
24
|
try {
|
|
28
|
-
this.mqtt =
|
|
25
|
+
this.mqtt = mqtt.connect(this.config.mqttUrl, { reconnectPeriod: PROTECT_MQTT_RECONNECT_INTERVAL * 1000, rejectUnauthorized: false });
|
|
29
26
|
}
|
|
30
27
|
catch (error) {
|
|
31
28
|
if (error instanceof Error) {
|
|
32
29
|
switch (error.message) {
|
|
33
30
|
case "Missing protocol":
|
|
34
|
-
this.log.error("
|
|
31
|
+
this.log.error("MQTT Broker: Invalid URL provided: %s.", this.config.mqttUrl);
|
|
35
32
|
break;
|
|
36
33
|
default:
|
|
37
|
-
this.log.error("
|
|
34
|
+
this.log.error("MQTT Broker: Error: %s.", error.message);
|
|
38
35
|
break;
|
|
39
36
|
}
|
|
40
37
|
}
|
|
@@ -48,13 +45,13 @@ class ProtectMqtt {
|
|
|
48
45
|
this.isConnected = true;
|
|
49
46
|
// Magic incantation to redact passwords.
|
|
50
47
|
const redact = /^(?<pre>.*:\/{0,2}.*:)(?<pass>.*)(?<post>@.*)/;
|
|
51
|
-
this.log.info("
|
|
48
|
+
this.log.info("Connected to MQTT broker: %s (topic: %s).", this.config.mqttUrl.replace(redact, "$<pre>REDACTED$<post>"), this.config.mqttTopic);
|
|
52
49
|
});
|
|
53
50
|
// Notify the user when we've disconnected.
|
|
54
51
|
this.mqtt.on("close", () => {
|
|
55
52
|
if (this.isConnected) {
|
|
56
53
|
this.isConnected = false;
|
|
57
|
-
this.log.info("
|
|
54
|
+
this.log.info("Disconnected from MQTT broker: %s.", this.config.mqttUrl);
|
|
58
55
|
}
|
|
59
56
|
});
|
|
60
57
|
// Process inbound messages and pass it to the right message handler.
|
|
@@ -65,63 +62,58 @@ class ProtectMqtt {
|
|
|
65
62
|
});
|
|
66
63
|
// Notify the user when there's a connectivity error.
|
|
67
64
|
this.mqtt.on("error", (error) => {
|
|
68
|
-
var _a;
|
|
69
65
|
switch (error.code) {
|
|
70
66
|
case "ECONNREFUSED":
|
|
71
|
-
this.log.error("
|
|
67
|
+
this.log.error("MQTT Broker: Connection refused (url: %s). Will retry again in %s minute%s.", this.config.mqttUrl, PROTECT_MQTT_RECONNECT_INTERVAL / 60, PROTECT_MQTT_RECONNECT_INTERVAL / 60 > 1 ? "s" : "");
|
|
72
68
|
break;
|
|
73
69
|
case "ECONNRESET":
|
|
74
|
-
this.log.error("
|
|
70
|
+
this.log.error("MQTT Broker: Connection reset (url: %s). Will retry again in %s minute%s.", this.config.mqttUrl, PROTECT_MQTT_RECONNECT_INTERVAL / 60, PROTECT_MQTT_RECONNECT_INTERVAL / 60 > 1 ? "s" : "");
|
|
75
71
|
break;
|
|
76
72
|
case "ENOTFOUND":
|
|
77
|
-
|
|
78
|
-
this.log.error("
|
|
73
|
+
this.mqtt?.end(true);
|
|
74
|
+
this.log.error("MQTT Broker: Hostname or IP address not found. (url: %s).", this.config.mqttUrl);
|
|
79
75
|
break;
|
|
80
76
|
default:
|
|
81
|
-
this.log.error("
|
|
77
|
+
this.log.error("MQTT Broker: %s (url: %s). Will retry again in %s minute%s.", error, this.config.mqttUrl, PROTECT_MQTT_RECONNECT_INTERVAL / 60, PROTECT_MQTT_RECONNECT_INTERVAL / 60 > 1 ? "s" : "");
|
|
82
78
|
break;
|
|
83
79
|
}
|
|
84
80
|
});
|
|
85
81
|
}
|
|
86
82
|
// Publish an MQTT event to a broker.
|
|
87
83
|
publish(accessory, topic, message) {
|
|
88
|
-
var _a;
|
|
89
84
|
const expandedTopic = this.expandTopic(accessory, topic);
|
|
90
85
|
// No valid topic returned, we're done.
|
|
91
86
|
if (!expandedTopic) {
|
|
92
87
|
return;
|
|
93
88
|
}
|
|
94
|
-
this.debug("
|
|
89
|
+
this.log.debug("MQTT publish: %s Message: %s.", expandedTopic, message);
|
|
95
90
|
// By default, we publish as: unifi/protect/mac/event/name
|
|
96
|
-
|
|
91
|
+
this.mqtt?.publish(expandedTopic, message);
|
|
97
92
|
}
|
|
98
93
|
// Subscribe to an MQTT topic.
|
|
99
94
|
subscribe(accessory, topic, callback) {
|
|
100
|
-
var _a;
|
|
101
95
|
const expandedTopic = this.expandTopic(accessory, topic);
|
|
102
96
|
// No valid topic returned, we're done.
|
|
103
97
|
if (!expandedTopic) {
|
|
104
98
|
return;
|
|
105
99
|
}
|
|
106
|
-
this.debug("
|
|
100
|
+
this.log.debug("MQTT subscribe: %s.", expandedTopic);
|
|
107
101
|
// Add to our callback list.
|
|
108
102
|
this.subscriptions[expandedTopic] = callback;
|
|
109
103
|
// Tell MQTT we're subscribing to this event.
|
|
110
104
|
// By default, we subscribe as: unifi/protect/mac/event/name.
|
|
111
|
-
|
|
105
|
+
this.mqtt?.subscribe(expandedTopic);
|
|
112
106
|
}
|
|
113
107
|
// Subscribe to a specific MQTT topic and publish a value on a get request.
|
|
114
108
|
subscribeGet(accessory, name, topic, type, getValue) {
|
|
115
|
-
var _a;
|
|
116
109
|
// Return the current status of a given sensor.
|
|
117
|
-
|
|
118
|
-
var _a;
|
|
110
|
+
this.nvr.mqtt?.subscribe(accessory, topic + "/get", (message) => {
|
|
119
111
|
const value = message.toString().toLowerCase();
|
|
120
112
|
// When we get the right message, we return the system information JSON.
|
|
121
113
|
if (value !== "true") {
|
|
122
114
|
return;
|
|
123
115
|
}
|
|
124
|
-
|
|
116
|
+
this.nvr.mqtt?.publish(accessory, topic, getValue());
|
|
125
117
|
this.log.info("%s: %s information published via MQTT.", name, type);
|
|
126
118
|
});
|
|
127
119
|
}
|
|
@@ -144,11 +136,10 @@ class ProtectMqtt {
|
|
|
144
136
|
let mac = (typeof accessory === "string") ? accessory : accessory.context.nvr;
|
|
145
137
|
// Check to see if it's really a Protect device...if it is, use it's MAC address.
|
|
146
138
|
if ((typeof accessory !== "string") && ("device" in accessory.context)) {
|
|
147
|
-
mac = accessory.
|
|
139
|
+
mac = this.nvr.configuredDevices[accessory.UUID]?.ufp.mac;
|
|
148
140
|
}
|
|
149
141
|
const expandedTopic = this.config.mqttTopic + "/" + mac + "/" + topic;
|
|
150
142
|
return expandedTopic;
|
|
151
143
|
}
|
|
152
144
|
}
|
|
153
|
-
exports.ProtectMqtt = ProtectMqtt;
|
|
154
145
|
//# sourceMappingURL=protect-mqtt.js.map
|
package/dist/protect-mqtt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protect-mqtt.js","sourceRoot":"","sources":["../src/protect-mqtt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protect-mqtt.js","sourceRoot":"","sources":["../src/protect-mqtt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,IAAoB,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAOhE,MAAM,OAAO,WAAW;IAStB,YAAY,GAAe;QAEzB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC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E1F,iFAAiF;QACjF,IAAG,CAAC,OAAO,SAAS,KAAK,QAAQ,CAAC,IAAI,CAAC,QAAQ,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE;YAErE,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;SAC3D;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC;QAEtE,OAAO,aAAa,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from "node:events";
|
|
3
|
+
import { ProtectCamera } from "./protect-camera.js";
|
|
4
|
+
import { ProtectDevice } from "./protect-device.js";
|
|
5
|
+
import { ProtectNvr } from "./protect-nvr.js";
|
|
6
|
+
export declare class ProtectNvrEvents extends EventEmitter {
|
|
7
|
+
private api;
|
|
8
|
+
private hap;
|
|
9
|
+
private lastMotion;
|
|
10
|
+
private lastRing;
|
|
11
|
+
private log;
|
|
12
|
+
private motionDuration;
|
|
13
|
+
private nvr;
|
|
14
|
+
private readonly eventTimers;
|
|
15
|
+
private ufpApi;
|
|
16
|
+
private ufpDeviceState;
|
|
17
|
+
private platform;
|
|
18
|
+
private ringDuration;
|
|
19
|
+
private unsupportedDevices;
|
|
20
|
+
private eventsHandler;
|
|
21
|
+
private ufpUpdatesHandler;
|
|
22
|
+
constructor(nvr: ProtectNvr);
|
|
23
|
+
private patchUfpConfigJson;
|
|
24
|
+
private ufpUpdates;
|
|
25
|
+
private manageDevices;
|
|
26
|
+
private configureEvents;
|
|
27
|
+
motionEventHandler(protectDevice: ProtectDevice, lastMotion: number, detectedObjects?: string[]): void;
|
|
28
|
+
private motionEventDelivery;
|
|
29
|
+
doorbellEventHandler(protectDevice: ProtectCamera, lastRing: number | null): void;
|
|
30
|
+
}
|