homebridge-unifi-protect 5.5.4 → 6.0.1

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.
Files changed (79) hide show
  1. package/README.md +3 -3
  2. package/config.schema.json +17 -16
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.js +6 -6
  5. package/dist/index.js.map +1 -1
  6. package/dist/protect-camera.d.ts +58 -0
  7. package/dist/protect-camera.js +367 -246
  8. package/dist/protect-camera.js.map +1 -1
  9. package/dist/protect-device.d.ts +48 -0
  10. package/dist/protect-device.js +189 -0
  11. package/dist/protect-device.js.map +1 -0
  12. package/dist/protect-doorbell.d.ts +22 -0
  13. package/dist/protect-doorbell.js +75 -64
  14. package/dist/protect-doorbell.js.map +1 -1
  15. package/dist/protect-ffmpeg-record.d.ts +15 -0
  16. package/dist/protect-ffmpeg-record.js +48 -34
  17. package/dist/protect-ffmpeg-record.js.map +1 -1
  18. package/dist/protect-ffmpeg-stream.d.ts +15 -0
  19. package/dist/protect-ffmpeg-stream.js +22 -12
  20. package/dist/protect-ffmpeg-stream.js.map +1 -1
  21. package/dist/protect-ffmpeg.d.ts +42 -0
  22. package/dist/protect-ffmpeg.js +49 -58
  23. package/dist/protect-ffmpeg.js.map +1 -1
  24. package/dist/protect-light.d.ts +13 -0
  25. package/dist/protect-light.js +63 -40
  26. package/dist/protect-light.js.map +1 -1
  27. package/dist/protect-liveviews.d.ts +17 -0
  28. package/dist/protect-liveviews.js +117 -101
  29. package/dist/protect-liveviews.js.map +1 -1
  30. package/dist/protect-mqtt.d.ts +19 -0
  31. package/dist/protect-mqtt.js +26 -35
  32. package/dist/protect-mqtt.js.map +1 -1
  33. package/dist/protect-nvr-events.d.ts +30 -0
  34. package/dist/protect-nvr-events.js +168 -431
  35. package/dist/protect-nvr-events.js.map +1 -1
  36. package/dist/protect-nvr-systeminfo.d.ts +15 -0
  37. package/dist/protect-nvr-systeminfo.js +43 -49
  38. package/dist/protect-nvr-systeminfo.js.map +1 -1
  39. package/dist/protect-nvr.d.ts +48 -0
  40. package/dist/protect-nvr.js +327 -359
  41. package/dist/protect-nvr.js.map +1 -1
  42. package/dist/protect-options.d.ts +39 -0
  43. package/dist/protect-options.js +172 -6
  44. package/dist/protect-options.js.map +1 -1
  45. package/dist/protect-platform.d.ts +17 -0
  46. package/dist/protect-platform.js +17 -30
  47. package/dist/protect-platform.js.map +1 -1
  48. package/dist/protect-record.d.ts +33 -0
  49. package/dist/protect-record.js +130 -126
  50. package/dist/protect-record.js.map +1 -1
  51. package/dist/protect-rtp.d.ts +29 -0
  52. package/dist/protect-rtp.js +133 -16
  53. package/dist/protect-rtp.js.map +1 -1
  54. package/dist/protect-securitysystem.d.ts +18 -0
  55. package/dist/protect-securitysystem.js +105 -109
  56. package/dist/protect-securitysystem.js.map +1 -1
  57. package/dist/protect-sensor.d.ts +28 -0
  58. package/dist/protect-sensor.js +79 -97
  59. package/dist/protect-sensor.js.map +1 -1
  60. package/dist/protect-stream.d.ts +41 -0
  61. package/dist/protect-stream.js +298 -156
  62. package/dist/protect-stream.js.map +1 -1
  63. package/dist/protect-timeshift.d.ts +30 -0
  64. package/dist/protect-timeshift.js +65 -48
  65. package/dist/protect-timeshift.js.map +1 -1
  66. package/dist/protect-types.d.ts +50 -0
  67. package/dist/protect-types.js +22 -0
  68. package/dist/protect-types.js.map +1 -0
  69. package/dist/protect-viewer.d.ts +17 -0
  70. package/dist/protect-viewer.js +41 -47
  71. package/dist/protect-viewer.js.map +1 -1
  72. package/dist/settings.d.ts +22 -0
  73. package/dist/settings.js +30 -35
  74. package/dist/settings.js.map +1 -1
  75. package/homebridge-ui/public/index.html +715 -0
  76. package/homebridge-ui/server.js +156 -0
  77. package/package.json +15 -15
  78. package/dist/protect-accessory.js +0 -184
  79. package/dist/protect-accessory.js.map +0 -1
@@ -1,42 +1,41 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProtectDoorbell = void 0;
4
- const protect_camera_1 = require("./protect-camera");
5
- class ProtectDoorbell extends protect_camera_1.ProtectCamera {
1
+ import { ProtectCamera } from "./protect-camera.js";
2
+ export class ProtectDoorbell extends ProtectCamera {
3
+ // Create an instance.
4
+ constructor(nvr, device, accessory) {
5
+ super(nvr, device, accessory);
6
+ }
6
7
  // Configure the doorbell for HomeKit.
7
8
  async configureDevice() {
8
- var _a, _b, _c, _d, _e, _f;
9
- this.defaultDuration = ((_e = (_d = (_c = (_b = (_a = this.nvr) === null || _a === void 0 ? void 0 : _a.nvrApi) === null || _b === void 0 ? void 0 : _b.bootstrap) === null || _c === void 0 ? void 0 : _c.nvr) === null || _d === void 0 ? void 0 : _d.doorbellSettings) === null || _e === void 0 ? void 0 : _e.defaultMessageResetTimeoutMs) === undefined ? 60000 :
10
- this.nvr.nvrApi.bootstrap.nvr.doorbellSettings.defaultMessageResetTimeoutMs;
9
+ this.defaultDuration = this.nvr.ufp.doorbellSettings?.defaultMessageResetTimeoutMs ?? 60000;
11
10
  this.isMessagesEnabled = true;
12
11
  this.isMessagesFromControllerEnabled = true;
13
12
  this.messageSwitches = [];
14
13
  // We only want to deal with cameras with chimes.
15
- if (!((_f = this.accessory.context.device) === null || _f === void 0 ? void 0 : _f.featureFlags.hasChime)) {
14
+ if (!this.ufp.featureFlags.hasChime) {
16
15
  return false;
17
16
  }
18
17
  // The user has disabled the doorbell message functionality.
19
- if (!this.nvr.optionEnabled(this.accessory.context.device, "Doorbell.Messages")) {
18
+ if (!this.nvr.optionEnabled(this.ufp, "Doorbell.Messages")) {
20
19
  this.isMessagesEnabled = false;
21
20
  }
22
21
  // The user has disabled the doorbell message functionality.
23
- if (!this.nvr.optionEnabled(this.accessory.context.device, "Doorbell.Messages.FromDoorbell")) {
22
+ if (!this.nvr.optionEnabled(this.ufp, "Doorbell.Messages.FromDoorbell")) {
24
23
  this.isMessagesFromControllerEnabled = false;
25
24
  }
26
25
  // Call our parent to setup the camera portion of the doorbell.
27
26
  await super.configureDevice();
28
27
  // Let's setup the doorbell-specific attributes.
29
28
  this.configureVideoDoorbell();
30
- this.nvr.doorbellCount++;
31
29
  // Now, make the doorbell LCD message functionality available.
32
- return this.configureDoorbellLcdSwitch();
30
+ this.configureDoorbellLcdSwitch();
31
+ // Register our event handlers.
32
+ this.nvr.events.on("updateEvent." + this.nvr.ufp.id, this.listeners["updateEvent." + this.nvr.ufp.id] = this.nvrEventHandler.bind(this));
33
+ return true;
33
34
  }
34
- // Configure our access to the Doorbell LCD screen.
35
+ // Configure our access to the doorbell LCD screen.
35
36
  configureDoorbellLcdSwitch() {
36
- var _a, _b, _c;
37
- const camera = (_a = this.accessory) === null || _a === void 0 ? void 0 : _a.context.device;
38
37
  // Make sure we're configuring a camera device with an LCD screen (aka a doorbell).
39
- if (((camera === null || camera === void 0 ? void 0 : camera.modelKey) !== "camera") || !(camera === null || camera === void 0 ? void 0 : camera.featureFlags.hasLcdScreen)) {
38
+ if ((this.ufp.modelKey !== "camera") || !this.ufp.featureFlags.hasLcdScreen) {
40
39
  return false;
41
40
  }
42
41
  // Grab the consolidated list of messages from the doorbell and our configuration.
@@ -52,10 +51,10 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
52
51
  continue;
53
52
  }
54
53
  // Check to see if we already have this message switch configured.
55
- if ((_b = this.messageSwitches) === null || _b === void 0 ? void 0 : _b.some(x => (x.type === entry.type) && (x.text === entry.text))) {
54
+ if (this.messageSwitches?.some(x => (x.type === entry.type) && (x.text === entry.text))) {
56
55
  continue;
57
56
  }
58
- this.log.info("%s: Discovered doorbell message switch%s: %s.", this.name(), entry.duration ? " (" + (entry.duration / 1000).toString() + " seconds)" : "", entry.text);
57
+ this.log.info("Discovered doorbell message switch%s: %s.", entry.duration ? " (" + (entry.duration / 1000).toString() + " seconds)" : "", entry.text);
59
58
  // Use the message switch, if it already exists.
60
59
  let switchService = this.accessory.getServiceById(this.hap.Service.Switch, entry.type + "." + entry.text);
61
60
  // It's a new message, let's create the service for it. Each message cannot exceed 30 characters, but
@@ -63,7 +62,7 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
63
62
  if (!switchService) {
64
63
  switchService = new this.hap.Service.Switch(entry.text, entry.type + "." + entry.text);
65
64
  if (!switchService) {
66
- this.log.error("%s: Unable to add doorbell message switch: %s.", this.name(), entry.text);
65
+ this.log.error("Unable to add doorbell message switch: %s.", entry.text);
67
66
  continue;
68
67
  }
69
68
  this.accessory.addService(switchService);
@@ -72,35 +71,34 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
72
71
  // Save the message switch in the list we maintain.
73
72
  this.messageSwitches.push({ duration: duration, service: switchService, state: false, text: entry.text, type: entry.type }) - 1;
74
73
  // Configure the message switch.
75
- (_c = switchService
76
- .getCharacteristic(this.hap.Characteristic.On)) === null || _c === void 0 ? void 0 : _c.onGet(this.getSwitchState.bind(this, this.messageSwitches[this.messageSwitches.length - 1])).onSet(this.setSwitchState.bind(this, this.messageSwitches[this.messageSwitches.length - 1]));
74
+ switchService
75
+ .getCharacteristic(this.hap.Characteristic.On)
76
+ ?.onGet(this.getSwitchState.bind(this, this.messageSwitches[this.messageSwitches.length - 1]))
77
+ .onSet(this.setSwitchState.bind(this, this.messageSwitches[this.messageSwitches.length - 1]));
77
78
  }
78
79
  // Update the message switch state in HomeKit.
79
- this.updateLcdSwitch(camera.lcdMessage);
80
+ this.updateLcdSwitch(this.ufp.lcdMessage);
80
81
  // Check to see if any of our existing doorbell messages have disappeared.
81
82
  this.validateMessageSwitches(doorbellMessages);
82
83
  return true;
83
84
  }
84
85
  // Configure MQTT capabilities for the doorbell.
85
86
  configureMqtt() {
86
- var _a, _b;
87
87
  // Call our parent to setup the general camera MQTT capabilities.
88
88
  super.configureMqtt();
89
89
  // Get the current message on the doorbell.
90
- (_a = this.nvr.mqtt) === null || _a === void 0 ? void 0 : _a.subscribe(this.accessory, "message/get", (message) => {
91
- var _a, _b, _c;
90
+ this.nvr.mqtt?.subscribe(this.accessory, "message/get", (message) => {
92
91
  const value = message.toString();
93
92
  // When we get the right message, we return the current message set on the doorbell.
94
- if ((value === null || value === void 0 ? void 0 : value.toLowerCase()) !== "true") {
93
+ if (value?.toLowerCase() !== "true") {
95
94
  return;
96
95
  }
97
- const device = this.accessory.context.device;
98
- const doorbellMessage = (_b = (_a = device.lcdMessage) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : "";
99
- const doorbellDuration = (("resetAt" in device.lcdMessage) && device.lcdMessage.resetAt !== null) ?
100
- Math.round((device.lcdMessage.resetAt - Date.now()) / 1000) : 0;
96
+ const doorbellMessage = this.ufp.lcdMessage?.text ?? "";
97
+ const doorbellDuration = (("resetAt" in this.ufp.lcdMessage) && this.ufp.lcdMessage.resetAt !== null) ?
98
+ Math.round((this.ufp.lcdMessage.resetAt - Date.now()) / 1000) : 0;
101
99
  // Publish the current message.
102
- (_c = this.nvr.mqtt) === null || _c === void 0 ? void 0 : _c.publish(this.accessory, "message", JSON.stringify({ duration: doorbellDuration, message: doorbellMessage }));
103
- this.log.info("%s: Doorbell message information published via MQTT.", this.name());
100
+ this.nvr.mqtt?.publish(this.accessory, "message", JSON.stringify({ duration: doorbellDuration, message: doorbellMessage }));
101
+ this.log.info("Doorbell message information published via MQTT.");
104
102
  });
105
103
  // We support the ability to set the doorbell message like so:
106
104
  //
@@ -109,7 +107,7 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
109
107
  // If duration is omitted, we assume the default duration.
110
108
  // If duration is 0, we assume it's not expiring.
111
109
  // If the message is blank, we assume we're resetting the doorbell message.
112
- (_b = this.nvr.mqtt) === null || _b === void 0 ? void 0 : _b.subscribe(this.accessory, "message/set", (message) => {
110
+ this.nvr.mqtt?.subscribe(this.accessory, "message/set", (message) => {
113
111
  let incomingPayload;
114
112
  let outboundPayload;
115
113
  // Catch any errors in parsing what we get over MQTT.
@@ -122,10 +120,10 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
122
120
  }
123
121
  catch (error) {
124
122
  if (error instanceof SyntaxError) {
125
- this.log.error("%s: Unable to process MQTT message: \"%s\". Error: %s.", this.name(), message.toString(), error.message);
123
+ this.log.error("Unable to process MQTT message: \"%s\". Error: %s.", message.toString(), error.message);
126
124
  }
127
125
  else {
128
- this.log.error("%s: Unknown error has occurred: %s.", this.name(), error);
126
+ this.log.error("Unknown error has occurred: %s.", error);
129
127
  }
130
128
  // Errors mean that we're done now.
131
129
  return;
@@ -134,7 +132,7 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
134
132
  // Our NaN test may seem strange - that's because NaN is the only JavaScript value that is treated as unequal
135
133
  // to itself. Meaning, you can always test if a value is NaN by checking it for equality to itself. Weird huh?
136
134
  if (!("message" in incomingPayload) || (("duration" in incomingPayload) && (incomingPayload.duration !== incomingPayload.duration))) {
137
- this.log.error("%s: Unable to process MQTT message: \"%s\".", this.name(), incomingPayload);
135
+ this.log.error("Unable to process MQTT message: \"%s\".", incomingPayload);
138
136
  return;
139
137
  }
140
138
  // If no duration specified, or a negative duration, we assume the default duration.
@@ -147,11 +145,11 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
147
145
  // No message defined...we assume we're resetting the message.
148
146
  if (!incomingPayload.message.length) {
149
147
  outboundPayload = { resetAt: 0 };
150
- this.log.info("%s: Received MQTT doorbell message reset.", this.name());
148
+ this.log.info("Received MQTT doorbell message reset.");
151
149
  }
152
150
  else {
153
151
  outboundPayload = { duration: incomingPayload.duration, text: incomingPayload.message, type: "CUSTOM_MESSAGE" };
154
- this.log.info("%s: Received MQTT doorbell message%s: %s.", this.name(), outboundPayload.duration ? " (" + (outboundPayload.duration / 1000).toString() + " seconds)" : "", outboundPayload.text);
152
+ this.log.info("Received MQTT doorbell message%s: %s.", outboundPayload.duration ? " (" + (outboundPayload.duration / 1000).toString() + " seconds)" : "", outboundPayload.text);
155
153
  }
156
154
  // Send it to the doorbell and we're done.
157
155
  void this.setMessage(outboundPayload);
@@ -160,9 +158,8 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
160
158
  }
161
159
  // Get the list of messages from the doorbell and the user configuration.
162
160
  getMessages() {
163
- var _a, _b, _c, _d;
164
161
  // First, we get our builtin and configured messages from the controller.
165
- const doorbellSettings = (_d = (_c = (_b = (_a = this.nvr) === null || _a === void 0 ? void 0 : _a.nvrApi) === null || _b === void 0 ? void 0 : _b.bootstrap) === null || _c === void 0 ? void 0 : _c.nvr) === null || _d === void 0 ? void 0 : _d.doorbellSettings;
162
+ const doorbellSettings = this.nvr.ufp.doorbellSettings;
166
163
  // Something's not right with the configuration...we're done.
167
164
  if (!doorbellSettings || !this.isMessagesEnabled) {
168
165
  return [];
@@ -181,7 +178,7 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
181
178
  }
182
179
  }
183
180
  // If we've got messages on the controller, let's configure those, unless the user has disabled that feature.
184
- if (this.isMessagesFromControllerEnabled && doorbellSettings.allMessages.length) {
181
+ if (this.isMessagesFromControllerEnabled) {
185
182
  doorbellMessages = doorbellSettings.allMessages.concat(doorbellMessages);
186
183
  }
187
184
  // Return the list of doorbell messages.
@@ -189,14 +186,13 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
189
186
  }
190
187
  // Validate our existing HomeKit message switch list.
191
188
  validateMessageSwitches(messageList) {
192
- var _a, _b;
193
189
  // Figure out if there's anything that's disappeared in the canonical list from the doorbell.
194
190
  for (const entry of this.messageSwitches) {
195
191
  // This exists on the doorbell...move along.
196
- if (messageList === null || messageList === void 0 ? void 0 : messageList.some(x => (x.type === entry.type) && (x.text === entry.text))) {
192
+ if (messageList?.some(x => (x.type === entry.type) && (x.text === entry.text))) {
197
193
  continue;
198
194
  }
199
- this.log.info("%s: Removing saved doorbell message: %s.", this.name(), entry.text);
195
+ this.log.info("Removing saved doorbell message: %s.", entry.text);
200
196
  // The message has been deleted on the doorbell, remove it in HomeKit.
201
197
  this.accessory.removeService(entry.service);
202
198
  this.messageSwitches.splice(this.messageSwitches.indexOf(entry), 1);
@@ -214,17 +210,16 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
214
210
  continue;
215
211
  }
216
212
  // The message exists on the doorbell.
217
- if ((_a = this.messageSwitches) === null || _a === void 0 ? void 0 : _a.some(x => (x.type + "." + x.text) === switchService.subtype)) {
213
+ if (this.messageSwitches?.some(x => (x.type + "." + x.text) === switchService.subtype)) {
218
214
  continue;
219
215
  }
220
216
  // The message has been deleted on the doorbell - remove it from HomeKit and inform the user about it.
221
- this.log.info("%s: Removing saved doorbell message: %s.", this.name(), (_b = switchService.subtype) === null || _b === void 0 ? void 0 : _b.slice(switchService.subtype.indexOf(".") + 1));
217
+ this.log.info("Removing saved doorbell message: %s.", switchService.subtype?.slice(switchService.subtype.indexOf(".") + 1));
222
218
  this.accessory.removeService(switchService);
223
219
  }
224
220
  }
225
221
  // Update the message switch state in HomeKit.
226
222
  updateLcdSwitch(lcdMessage) {
227
- var _a, _b;
228
223
  // The message has been cleared on the doorbell, turn off all message switches in HomeKit.
229
224
  if (!Object.keys(lcdMessage).length) {
230
225
  for (const lcdEntry of this.messageSwitches) {
@@ -252,9 +247,9 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
252
247
  // Set the message state and update HomeKit.
253
248
  lcdEntry.state = true;
254
249
  lcdEntry.service.updateCharacteristic(this.hap.Characteristic.On, true);
255
- this.log.info("%s: Doorbell message set%s: %s.", this.name(), lcdMessage.resetAt !== null ? " (" + Math.round((((_a = lcdMessage.resetAt) !== null && _a !== void 0 ? _a : 0) - Date.now()) / 1000).toString() + " seconds)" : "", lcdMessage.text);
250
+ this.log.info("Doorbell message set%s: %s.", lcdMessage.resetAt !== null ? " (" + Math.round(((lcdMessage.resetAt ?? 0) - Date.now()) / 1000).toString() + " seconds)" : "", lcdMessage.text);
256
251
  // Publish to MQTT, if the user has configured it.
257
- (_b = this.nvr.mqtt) === null || _b === void 0 ? void 0 : _b.publish(this.accessory, "message", JSON.stringify({ duration: lcdEntry.duration / 1000, message: lcdEntry.text }));
252
+ this.nvr.mqtt?.publish(this.accessory, "message", JSON.stringify({ duration: lcdEntry.duration / 1000, message: lcdEntry.text }));
258
253
  }
259
254
  }
260
255
  // Get the current state of this message switch.
@@ -265,34 +260,50 @@ class ProtectDoorbell extends protect_camera_1.ProtectCamera {
265
260
  async setSwitchState(messageSwitch, value) {
266
261
  // Tell the doorbell to display our message.
267
262
  if (messageSwitch.state !== value) {
268
- const payload = (value === true) ?
269
- { duration: messageSwitch.duration, text: messageSwitch.text, type: messageSwitch.type } :
270
- { resetAt: 0 };
263
+ const payload = (value === true) ? { duration: messageSwitch.duration, text: messageSwitch.text, type: messageSwitch.type } : {};
271
264
  // Set the message and sync our states.
272
265
  await this.setMessage(payload);
273
266
  }
274
267
  }
275
268
  // Set the message on the doorbell.
276
- async setMessage(payload = { resetAt: 0 }) {
269
+ async setMessage(payload = {}) {
277
270
  // We take the duration and save it for MQTT and then translate the payload into what Protect is expecting from us.
278
271
  if ("duration" in payload) {
279
272
  payload.resetAt = payload.duration ? Date.now() + payload.duration : null;
280
273
  delete payload.duration;
281
274
  }
282
- // An empty payload means we're resetting. Set the reset timer to 0 and we're done.
283
- if (!Object.keys(payload).length) {
284
- payload.resetAt = 0;
285
- }
286
- // Push the update to the doorbell.
287
- const newDevice = await this.nvr.nvrApi.updateCamera(this.accessory.context.device, { lcdMessage: payload });
275
+ // Push the update to the doorbell. If we have an empty payload, it means we're resetting the LCD message back to it's default.
276
+ const newDevice = await this.nvr.ufpApi.updateDevice(this.ufp, { lcdMessage: payload });
288
277
  if (!newDevice) {
289
- this.log.error("%s: Unable to set doorbell message. Please ensure this username has the Administrator role in UniFi Protect.", this.name());
278
+ this.log.error("Unable to set doorbell message. Please ensure this username has the Administrator role in UniFi Protect.");
290
279
  return false;
291
280
  }
292
- // Set the context to our updated device configuration.
293
- this.accessory.context.device = newDevice;
281
+ // Set our updated device configuration.
282
+ this.ufp = newDevice;
294
283
  return true;
295
284
  }
285
+ // Handle doorbell-related events.
286
+ eventHandler(packet) {
287
+ const payload = packet.payload;
288
+ super.eventHandler(packet);
289
+ // Process LCD message events.
290
+ if (payload.lcdMessage) {
291
+ this.updateLcdSwitch(payload.lcdMessage);
292
+ }
293
+ }
294
+ // Handle doorbell saved message updates on the Protect controller.
295
+ nvrEventHandler(packet) {
296
+ const payload = packet.payload;
297
+ // Process doorbell message save events.
298
+ if (payload.doorbellSettings) {
299
+ // We need to proactively update the allMessages object. This feels like a UniFi Protect bug, but all we can do is work around it.
300
+ if (payload.doorbellSettings.customMessages) {
301
+ const builtinMessages = this.nvr.ufp.doorbellSettings.allMessages.filter(x => x.type !== "CUSTOM_MESSAGE");
302
+ const customMessages = payload.doorbellSettings.customMessages.map(x => ({ text: x, type: "CUSTOM_MESSAGE" }));
303
+ this.nvr.ufp.doorbellSettings.allMessages = builtinMessages.concat(customMessages);
304
+ }
305
+ this.configureDoorbellLcdSwitch();
306
+ }
307
+ }
296
308
  }
297
- exports.ProtectDoorbell = ProtectDoorbell;
298
309
  //# sourceMappingURL=protect-doorbell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"protect-doorbell.js","sourceRoot":"","sources":["../src/protect-doorbell.ts"],"names":[],"mappings":";;;AASA,qDAAiD;AAejD,MAAa,eAAgB,SAAQ,8BAAa;IAOhD,sCAAsC;IAC5B,KAAK,CAAC,eAAe;;QAE7B,IAAI,CAAC,eAAe,GAAG,CAAA,MAAA,MAAA,MAAA,MAAA,MAAA,IAAI,CAAC,GAAG,0CAAE,MAAM,0CAAE,SAAS,0CAAE,GAAG,0CAAE,gBAAgB,0CAAE,4BAA4B,MAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC7H,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,4BAA4B,CAAC;QAC9E,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,+BAA+B,GAAG,IAAI,CAAC;QAC5C,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;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,MAA0B;QAE/C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAqC,CAAC;QAE7D,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAE3B,8BAA8B;QAC9B,IAAG,OAAO,CAAC,UAAU,EAAE;YAErB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SAC1C;IACH,CAAC;IAED,mEAAmE;IAC3D,eAAe,CAAC,MAA0B;QAEhD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAkC,CAAC;QAE1D,wCAAwC;QACxC,IAAG,OAAO,CAAC,gBAAgB,EAAE;YAE3B,kIAAkI;YAClI,IAAG,OAAO,CAAC,gBAAgB,CAAC,cAAc,EAAE;gBAE1C,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,gBAAgB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC;gBAC3G,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;gBAE/G,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,gBAAgB,CAAC,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;aACpF;YAED,IAAI,CAAC,0BAA0B,EAAE,CAAC;SACnC;IACH,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { ProtectCamera, RtspEntry } from "./protect-camera.js";
4
+ import { CameraRecordingConfiguration } from "homebridge";
5
+ import { FfmpegProcess } from "./protect-ffmpeg.js";
6
+ export declare class FfmpegRecordingProcess extends FfmpegProcess {
7
+ private isLoggingErrors;
8
+ private recordingBuffer;
9
+ constructor(protectCamera: ProtectCamera, recordingConfig: CameraRecordingConfiguration, rtspEntry: RtspEntry, isAudioActive: boolean);
10
+ protected configureProcess(): void;
11
+ protected stopProcess(): void;
12
+ stop(logErrors?: boolean): void;
13
+ protected logFfmpegError(exitCode: number, signal: NodeJS.Signals): void;
14
+ segmentGenerator(): AsyncGenerator<Buffer>;
15
+ }
@@ -1,30 +1,28 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FfmpegRecordingProcess = void 0;
7
- const protect_ffmpeg_1 = require("./protect-ffmpeg");
8
- const events_1 = __importDefault(require("events"));
1
+ import { FfmpegProcess } from "./protect-ffmpeg.js";
2
+ import events from "node:events";
3
+ import { platform } from "node:process";
9
4
  // FFmpeg HomeKit Streaming Video recording process management.
10
- class FfmpegRecordingProcess extends protect_ffmpeg_1.FfmpegProcess {
5
+ export class FfmpegRecordingProcess extends FfmpegProcess {
11
6
  // Create a new FFmpeg process instance.
12
7
  constructor(protectCamera, recordingConfig, rtspEntry, isAudioActive) {
13
- var _a;
14
8
  // Initialize our parent.
15
9
  super(protectCamera);
10
+ // We want to log errors when they occur.
11
+ this.isLoggingErrors = true;
16
12
  // Initialize our recording buffer.
17
13
  this.recordingBuffer = [];
18
14
  // Determine which H.264 profile HomeKit is expecting from us.
19
- const requestedProfile = (recordingConfig.videoCodec.parameters.profile === 2 /* H264Profile.HIGH */) ? "high"
20
- : (recordingConfig.videoCodec.parameters.profile === 1 /* H264Profile.MAIN */) ? "main" : "baseline";
21
- const requestedLevel = (recordingConfig.videoCodec.parameters.level === 2 /* H264Level.LEVEL4_0 */) ? "4.0"
22
- : (recordingConfig.videoCodec.parameters.level === 1 /* H264Level.LEVEL3_2 */) ? "3.2" : "3.1";
23
- // -hide_banner: Suppress printing the startup banner in FFmpeg.
15
+ const requestedProfile = protectCamera.stream.getH264Profile(recordingConfig.videoCodec.parameters.profile);
16
+ // Determine which H.264 level HomeKit is expecting form us. We override this for macOS when we've enabled hardware accelerated transcoding because
17
+ // the hardware encoder won't transcode to anything below level 5.1 on higher bitrate streams like the G4 Pro.
18
+ const requestedLevel = (protectCamera.hasHwAccel && (platform === "darwin")) ? "5.1" :
19
+ protectCamera.stream.getH264Level(recordingConfig.videoCodec.parameters.level);
20
+ // -hide_banner Suppress printing the startup banner in FFmpeg.
24
21
  this.commandLineArgs = [
25
22
  "-hide_banner"
26
23
  ];
27
- if ((_a = this.nvr) === null || _a === void 0 ? void 0 : _a.optionEnabled(protectCamera.accessory.context.device, "Video.HKSV.TimeshiftBuffer")) {
24
+ // If we're timeshifting, read from the timeshift buffer.
25
+ if (protectCamera.hints.timeshift) {
28
26
  // Configure our video parameters for our input:
29
27
  //
30
28
  // -fflags flags Set the format flags to discard any corrupt packets rather than exit, and ensure that packets are written out immediately.
@@ -37,13 +35,13 @@ class FfmpegRecordingProcess extends protect_ffmpeg_1.FfmpegProcess {
37
35
  // We're not using the timeshift buffer, so let's use the RTSP stream as the input to HKSV.
38
36
  //
39
37
  // -hide_banner Suppress printing the startup banner in FFmpeg.
40
- // -probesize 16384 How many bytes should be analyzed for stream information. We default to to analyze time should be spent analyzing
41
- // the input stream, in microseconds. We default to 1536.
38
+ // -probesize 8192 How many bytes should be analyzed for stream information. We default to to analyze time should be spent analyzing
39
+ // the input stream.
42
40
  // -max_delay 500000 Set an upper limit on how much time FFmpeg can take in demuxing packets.
43
41
  // -r fps Set the input frame rate for the video stream.
44
42
  // -rtsp_transport tcp Tell the RTSP stream handler that we're looking for a TCP connection.
45
43
  // -i this.rtspEntry.url RTSPS URL to get our input stream from.
46
- this.commandLineArgs.push("-probesize", "16384", "-max_delay", "500000", "-r", rtspEntry.channel.fps.toString(), "-rtsp_transport", "tcp", "-i", rtspEntry.url);
44
+ this.commandLineArgs.push("-probesize", "8192", "-max_delay", "500000", "-r", rtspEntry.channel.fps.toString(), "-rtsp_transport", "tcp", "-i", rtspEntry.url);
47
45
  }
48
46
  // -map 0:v:0 Selects the first available video track from the stream. Protect actually maps audio
49
47
  // and video tracks in opposite locations from where FFmpeg typically expects them. This
@@ -54,12 +52,8 @@ class FfmpegRecordingProcess extends protect_ffmpeg_1.FfmpegProcess {
54
52
  // -max_muxing_queue_size 9999 Workaround for a bug in pre-20221 versions of FFmpeg. This will ensure that FFmpeg maintains a
55
53
  // a large enough queue to wait for an output packet to be available. Inputs aren't the issue in our
56
54
  // situation.
57
- // -vcodec libx264 Copy the stream withour reencoding it.
58
- // -pix_fmt yuvj420p Use the yuvj420p pixel format, which is what Protect uses.
59
55
  // -profile:v level Use the H.264 profile HKSV is requesting when encoding.
60
56
  // -level:v level Use the H.264 profile level HKSV is requesting when encoding.
61
- // -preset veryfast Use the veryfast encoding preset in libx264, which provides a good balance of encoding
62
- // speed and quality.
63
57
  // -b:v bitrate The average bitrate to use for this stream as requested by HKSV.
64
58
  // -bufsize size This is the decoder buffer size, which drives the variability / quality of the output bitrate.
65
59
  // -maxrate bitrate The maximum bitrate tolerance, used with -bufsize. We set this to max_bit_rate to effectively
@@ -69,15 +63,15 @@ class FfmpegRecordingProcess extends protect_ffmpeg_1.FfmpegProcess {
69
63
  // -reset_timestamps Reset timestamps at the beginning of each segment.
70
64
  // -movflags flags In the generated fMP4 stream: start a new fragment at each keyframe, write a blank MOOV box, and
71
65
  // avoid writing absolute offsets
72
- this.commandLineArgs.push("-map", "0:v:0", "-max_muxing_queue_size", "9999", "-vcodec", this.protectCamera.stream.videoEncoder || "libx264", "-pix_fmt", "yuvj420p", "-profile:v", requestedProfile, "-level:v", requestedLevel, "-preset", "veryfast", "-b:v", recordingConfig.videoCodec.parameters.bitRate.toString() + "k", "-bufsize", (2 * recordingConfig.videoCodec.parameters.bitRate).toString() + "k", "-maxrate", recordingConfig.videoCodec.parameters.bitRate.toString() + "k", "-force_key_frames", "expr:gte(t, n_forced * " + (recordingConfig.videoCodec.parameters.iFrameInterval / 1000).toString() + ")", "-fflags", "+genpts+discardcorrupt", "-reset_timestamps", "1", "-movflags", "frag_keyframe+empty_moov+default_base_moof");
66
+ this.commandLineArgs.push("-map", "0:v:0", "-max_muxing_queue_size", "9999", ...this.protectCamera.stream.videoEncoderOptions, "-profile:v", requestedProfile, "-level:v", requestedLevel, "-b:v", recordingConfig.videoCodec.parameters.bitRate.toString() + "k", "-bufsize", (2 * recordingConfig.videoCodec.parameters.bitRate).toString() + "k", "-maxrate", recordingConfig.videoCodec.parameters.bitRate.toString() + "k", "-force_key_frames", "expr:gte(t, n_forced * " + (recordingConfig.videoCodec.parameters.iFrameInterval / 1000).toString() + ")", "-fflags", "+genpts+discardcorrupt", "-reset_timestamps", "1", "-movflags", "frag_keyframe+empty_moov+default_base_moof");
73
67
  if (isAudioActive) {
74
68
  // Configure the audio portion of the command line. Options we use are:
75
69
  //
76
- // -map 0:a:0 Selects the first available audio track from the stream. Protect actually maps audio
70
+ // -map 0:a:0 Selects the first available audio track from the stream. Protect actually maps audio
77
71
  // and video tracks in opposite locations from where FFmpeg typically expects them. This
78
72
  // setting is a more general solution than naming the track locations directly in case
79
73
  // Protect changes this in the future.
80
- // -acodec copy Copy the stream withour reencoding it.
74
+ // -acodec copy Copy the stream without reencoding it.
81
75
  this.commandLineArgs.push("-map", "0:a:0", "-acodec", "copy");
82
76
  }
83
77
  // Configure our video parameters for outputting our final stream:
@@ -94,7 +88,6 @@ class FfmpegRecordingProcess extends protect_ffmpeg_1.FfmpegProcess {
94
88
  }
95
89
  // Prepare and start our FFmpeg process.
96
90
  configureProcess() {
97
- var _a, _b, _c;
98
91
  let dataListener;
99
92
  // Call our parent to get started.
100
93
  super.configureProcess();
@@ -104,7 +97,7 @@ class FfmpegRecordingProcess extends protect_ffmpeg_1.FfmpegProcess {
104
97
  let dataLength = 0;
105
98
  let type = "";
106
99
  // Process FFmpeg output and parse out the fMP4 stream it's generating for HomeKit Secure Video.
107
- (_b = (_a = this.process) === null || _a === void 0 ? void 0 : _a.stdout) === null || _b === void 0 ? void 0 : _b.on("data", dataListener = (buffer) => {
100
+ this.process?.stdout?.on("data", dataListener = (buffer) => {
108
101
  // If we have anything left from the last buffer we processed, prepend it to this buffer.
109
102
  if (bufferRemaining.length > 0) {
110
103
  buffer = Buffer.concat([bufferRemaining, buffer]);
@@ -138,7 +131,7 @@ class FfmpegRecordingProcess extends protect_ffmpeg_1.FfmpegProcess {
138
131
  offset = 0;
139
132
  }
140
133
  // If we don't have enough data in this buffer, save what we have for the next buffer we see and append it there.
141
- if (data.length < (dataLength - offset)) {
134
+ if (data.length < dataLength) {
142
135
  bufferRemaining = data;
143
136
  break;
144
137
  }
@@ -160,9 +153,8 @@ class FfmpegRecordingProcess extends protect_ffmpeg_1.FfmpegProcess {
160
153
  }
161
154
  });
162
155
  // Make sure we cleanup our listeners when we're done.
163
- (_c = this.process) === null || _c === void 0 ? void 0 : _c.once("exit", () => {
164
- var _a, _b;
165
- (_b = (_a = this.process) === null || _a === void 0 ? void 0 : _a.stdout) === null || _b === void 0 ? void 0 : _b.removeListener("data", dataListener);
156
+ this.process?.once("exit", () => {
157
+ this.process?.stdout?.removeListener("data", dataListener);
166
158
  });
167
159
  }
168
160
  // Stop our FFmpeg process and cleanup after ourselves.
@@ -174,6 +166,29 @@ class FfmpegRecordingProcess extends protect_ffmpeg_1.FfmpegProcess {
174
166
  this.emit("ffmpegStarted");
175
167
  this.emit("mp4box");
176
168
  }
169
+ // Stop an FFmpeg process and cleanup.
170
+ stop(logErrors = this.isLoggingErrors) {
171
+ const savedLogErrors = this.isLoggingErrors;
172
+ // Flag whether we should log abnormal exits (e.g. being killed) or not.
173
+ this.isLoggingErrors = logErrors;
174
+ // Call our parent to finish the job.
175
+ super.stop();
176
+ // Restore our previous logging state.
177
+ this.isLoggingErrors = savedLogErrors;
178
+ }
179
+ // Log errors.
180
+ logFfmpegError(exitCode, signal) {
181
+ // Known HKSV-related errors due to occasional inconsistencies in the Protect livestream API.
182
+ const ffmpegKnownHksvError = new RegExp("(Invalid data found when processing input)|(Could not write header for output file #0)");
183
+ // See if we know about this error.
184
+ if (this.stderrLog.some(x => ffmpegKnownHksvError.test(x))) {
185
+ this.log.error("FFmpeg ended unexpectedly due to issues with the media stream provided by the UniFi Protect livestream API. " +
186
+ "This error can be safely ignored - they will occur occasionally.");
187
+ return;
188
+ }
189
+ // Otherwise, revert to our default logging in our parent.
190
+ super.logFfmpegError(exitCode, signal);
191
+ }
177
192
  // Generate complete segments from an FFmpeg output stream that HomeKit Secure Video can process.
178
193
  async *segmentGenerator() {
179
194
  let segment = [];
@@ -186,7 +201,7 @@ class FfmpegRecordingProcess extends protect_ffmpeg_1.FfmpegProcess {
186
201
  // If the buffer is empty, wait for our FFmpeg process to produce more boxes.
187
202
  if (!this.recordingBuffer.length) {
188
203
  // eslint-disable-next-line no-await-in-loop
189
- await events_1.default.once(this, "mp4box");
204
+ await events.once(this, "mp4box");
190
205
  }
191
206
  // Grab the next fMP4 box from our buffer.
192
207
  const box = this.recordingBuffer.shift();
@@ -213,5 +228,4 @@ class FfmpegRecordingProcess extends protect_ffmpeg_1.FfmpegProcess {
213
228
  }
214
229
  }
215
230
  }
216
- exports.FfmpegRecordingProcess = FfmpegRecordingProcess;
217
231
  //# sourceMappingURL=protect-ffmpeg-record.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"protect-ffmpeg-record.js","sourceRoot":"","sources":["../src/protect-ffmpeg-record.ts"],"names":[],"mappings":";;;;;;AAOA,qDAAiD;AAEjD,oDAA4B;AAE5B,+DAA+D;AAC/D,MAAa,sBAAuB,SAAQ,8BAAa;IAIvD,wCAAwC;IACxC,YAAY,aAA4B,EAAE,eAA6C,EAAE,SAAoB,EAAE,aAAsB;;QAEnI,yBAAyB;QACzB,KAAK,CAAC,aAAa,CAAC,CAAC;QAErB,mCAAmC;QACnC,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAE1B,8DAA8D;QAC9D,MAAM,gBAAgB,GAAG,CAAC,eAAe,CAAC,UAAU,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,EAAE,CAAC;QAE3B,uGAAuG;QACvG,SAAQ;YAEN,gDAAgD;YAChD,IAAG,IAAI,CAAC,OAAO,EAAE;gBAEf,OAAO;aACR;YAED,6EAA6E;YAC7E,IAAG,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;gBAE/B,4CAA4C;gBAC5C,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;aACnC;YAED,0CAA0C;YAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;YAEzC,kCAAkC;YAClC,IAAG,CAAC,GAAG,EAAE;gBAEP,SAAS;aACV;YAED,kDAAkD;YAClD,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;YAEnC,0FAA0F;YAC1F,EAAE;YACF,wFAAwF;YACxF,4FAA4F;YAC5F,UAAU;YACV,EAAE;YACF,gGAAgG;YAChG,kCAAkC;YAClC,EAAE;YACF,uFAAuF;YACvF,IAAG,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,EAAE;gBAEjD,MAAM,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAC7B,OAAO,GAAG,EAAE,CAAC;aACd;SACF;IACH,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { FfmpegProcess, PortInterface } from "./protect-ffmpeg.js";
4
+ import { ChildProcessWithoutNullStreams } from "child_process";
5
+ import { ProtectStreamingDelegate } from "./protect-stream.js";
6
+ import { StreamRequestCallback } from "homebridge";
7
+ export declare class FfmpegStreamingProcess extends FfmpegProcess {
8
+ private delegate;
9
+ private sessionId;
10
+ private streamTimeout?;
11
+ constructor(delegate: ProtectStreamingDelegate, sessionId: string, commandLineArgs: string[], returnPort?: PortInterface, callback?: StreamRequestCallback);
12
+ private createSocket;
13
+ get ffmpegProcess(): ChildProcessWithoutNullStreams | null;
14
+ protected logFfmpegError(exitCode: number, signal: NodeJS.Signals): void;
15
+ }