homebridge-unifi-protect 7.0.0 → 7.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 (38) hide show
  1. package/dist/devices/protect-camera.d.ts +2 -0
  2. package/dist/devices/protect-camera.js +16 -7
  3. package/dist/devices/protect-camera.js.map +1 -1
  4. package/dist/devices/protect-device.d.ts +1 -1
  5. package/dist/devices/protect-device.js +6 -2
  6. package/dist/devices/protect-device.js.map +1 -1
  7. package/dist/devices/protect-doorbell.js +2 -2
  8. package/dist/devices/protect-doorbell.js.map +1 -1
  9. package/dist/devices/protect-viewer.js +1 -1
  10. package/dist/devices/protect-viewer.js.map +1 -1
  11. package/dist/ffmpeg/protect-ffmpeg-exec.js +1 -1
  12. package/dist/ffmpeg/protect-ffmpeg-exec.js.map +1 -1
  13. package/dist/ffmpeg/protect-ffmpeg-options.js +1 -0
  14. package/dist/ffmpeg/protect-ffmpeg-options.js.map +1 -1
  15. package/dist/ffmpeg/protect-ffmpeg-record.js +1 -1
  16. package/dist/ffmpeg/protect-ffmpeg-record.js.map +1 -1
  17. package/dist/protect-events.d.ts +0 -2
  18. package/dist/protect-events.js +2 -10
  19. package/dist/protect-events.js.map +1 -1
  20. package/dist/protect-livestream.d.ts +12 -0
  21. package/dist/protect-livestream.js +63 -0
  22. package/dist/protect-livestream.js.map +1 -0
  23. package/dist/protect-nvr.js +3 -3
  24. package/dist/protect-nvr.js.map +1 -1
  25. package/dist/protect-options.js.map +1 -1
  26. package/dist/protect-record.d.ts +2 -2
  27. package/dist/protect-record.js +2 -2
  28. package/dist/protect-record.js.map +1 -1
  29. package/dist/protect-stream.d.ts +0 -1
  30. package/dist/protect-stream.js +51 -30
  31. package/dist/protect-stream.js.map +1 -1
  32. package/dist/protect-timeshift.d.ts +12 -12
  33. package/dist/protect-timeshift.js +67 -82
  34. package/dist/protect-timeshift.js.map +1 -1
  35. package/homebridge-ui/public/lib/webUi-featureoptions.mjs +2 -2
  36. package/homebridge-ui/public/ui.mjs +8 -3
  37. package/homebridge-ui/server.js +1 -14
  38. package/package.json +4 -4
@@ -24,9 +24,9 @@ const firstRunIsRequired = () => {
24
24
  const firstRunOnStart = () => {
25
25
 
26
26
  // Pre-populate with anything we might already have in our configuration.
27
- document.getElementById("address").value = ui.featureOptions.currentConfig[0].controllers[0].address ?? "";
28
- document.getElementById("username").value = ui.featureOptions.currentConfig[0].controllers[0].username ?? "";
29
- document.getElementById("password").value = ui.featureOptions.currentConfig[0].controllers[0].password ?? "";
27
+ document.getElementById("address").value = ui.featureOptions.currentConfig[0].controllers?.[0]?.address ?? "";
28
+ document.getElementById("username").value = ui.featureOptions.currentConfig[0].controllers?.[0]?.username ?? "";
29
+ document.getElementById("password").value = ui.featureOptions.currentConfig[0].controllers?.[0]?.password ?? "";
30
30
 
31
31
  return true;
32
32
  };
@@ -61,6 +61,11 @@ const firstRunOnSubmit = async () => {
61
61
  }
62
62
 
63
63
  // Save the login credentials to our configuration.
64
+ if(!ui.featureOptions.currentConfig[0].controllers?.length) {
65
+
66
+ ui.featureOptions.currentConfig[0].controllers = [{}];
67
+ }
68
+
64
69
  ui.featureOptions.currentConfig[0].controllers[0].address = address;
65
70
  ui.featureOptions.currentConfig[0].controllers[0].username = username;
66
71
  ui.featureOptions.currentConfig[0].controllers[0].password = password;
@@ -38,20 +38,7 @@ class PluginUiServer extends HomebridgePluginUiServer {
38
38
  #registerGetErrorMessage() {
39
39
 
40
40
  // Return the most recent error message generated by the Protect API.
41
- this.onRequest("/getErrorMessage", async () => {
42
-
43
- try {
44
-
45
- return this.errorInfo;
46
- } catch(err) {
47
-
48
- // eslint-disable-next-line no-console
49
- console.log(err);
50
-
51
- // Return nothing if we error out for some reason.
52
- return "";
53
- }
54
- });
41
+ this.onRequest("/getErrorMessage", () => this.errorInfo);
55
42
  }
56
43
 
57
44
  // Register the getDevices() webUI server API endpoint.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-unifi-protect",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
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": {
@@ -77,13 +77,13 @@
77
77
  "dependencies": {
78
78
  "@homebridge/plugin-ui-utils": "1.0.3",
79
79
  "ffmpeg-for-homebridge": "2.1.1",
80
- "homebridge-plugin-utils": "^1.3.0",
81
- "unifi-protect": "^4.11.0",
80
+ "homebridge-plugin-utils": "^1.4.0",
81
+ "unifi-protect": "^4.11.1",
82
82
  "ws": "8.17.0"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@stylistic/eslint-plugin": "2.1.0",
86
- "@types/node": "20.14.0",
86
+ "@types/node": "20.14.2",
87
87
  "@types/readable-stream": "4.0.14",
88
88
  "@types/ws": "8.5.10",
89
89
  "eslint": "8.57.0",