@homebridge-plugins/homebridge-eufy-security 5.0.0-beta.1 → 5.0.0-beta.10

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 (35) hide show
  1. package/README.md +4 -6
  2. package/config.schema.json +20 -0
  3. package/dist/configuration.js +26 -2
  4. package/dist/configuration.js.map +1 -1
  5. package/dist/device/member-evidence.js +8 -1
  6. package/dist/device/member-evidence.js.map +1 -1
  7. package/dist/diagnostics.js +428 -60
  8. package/dist/diagnostics.js.map +1 -1
  9. package/dist/homekit/adapters/camera-streaming.js +54 -26
  10. package/dist/homekit/adapters/camera-streaming.js.map +1 -1
  11. package/dist/homekit/adapters/security-system.js +85 -44
  12. package/dist/homekit/adapters/security-system.js.map +1 -1
  13. package/dist/homekit/reconciler.js +5 -2
  14. package/dist/homekit/reconciler.js.map +1 -1
  15. package/dist/media/live-stream.js +98 -54
  16. package/dist/media/live-stream.js.map +1 -1
  17. package/dist/media/recording.js +7 -5
  18. package/dist/media/recording.js.map +1 -1
  19. package/dist/media/snapshot.js +4 -4
  20. package/dist/media/station-live-sessions.js +47 -43
  21. package/dist/media/station-live-sessions.js.map +1 -1
  22. package/dist/platform.js +24 -5
  23. package/dist/platform.js.map +1 -1
  24. package/dist/ui/dashboard.js +5 -1
  25. package/dist/ui/dashboard.js.map +1 -1
  26. package/dist/ui/server.js +26 -4
  27. package/dist/ui/server.js.map +1 -1
  28. package/homebridge-ui/public/app.css +356 -3
  29. package/homebridge-ui/public/i18n/en.json +25 -14
  30. package/homebridge-ui/public/i18n/fr.json +25 -14
  31. package/homebridge-ui/public/index.html +24 -32
  32. package/homebridge-ui/public/js/app.js +187 -65
  33. package/homebridge-ui/public/js/dashboard.js +80 -1
  34. package/homebridge-ui/public/js/profile-wizard.js +40 -28
  35. package/package.json +2 -2
@@ -1,37 +1,48 @@
1
1
  (function attachDiagnosticsWizard(global) {
2
- const questions = [
3
- { profile: 'dashboard-ui', message: 'diagnosticsQuestionDashboard' },
4
- { profile: 'startup-authentication', message: 'diagnosticsQuestionStartup' },
5
- { profile: 'device-representation', message: 'diagnosticsQuestionDevices' },
6
- { profile: 'control-state', message: 'diagnosticsQuestionControl' },
7
- { profile: 'live-media', message: 'diagnosticsQuestionLiveMedia' },
8
- { profile: 'hksv-recording', message: 'diagnosticsQuestionRecording' },
2
+ const profiles = [
3
+ 'startup-authentication',
4
+ 'device-representation',
5
+ 'control-state',
6
+ 'live-media',
7
+ 'hksv-recording',
8
+ 'dashboard-ui',
9
+ 'other',
9
10
  ];
10
11
 
11
- function start() {
12
- return { mode: 'questions', questionIndex: 0, profile: undefined, source: 'questions' };
12
+ const deviceProfiles = ['device-representation', 'control-state', 'live-media', 'hksv-recording'];
13
+
14
+ /**
15
+ * Whether a fault of a given area could be about a given device, per area that can tell.
16
+ *
17
+ * A device the fault cannot happen on is not an answer to which ones are affected: offering a HomeBase for a
18
+ * live view fault invites a report about a stream that device never had. Missing from the list means every
19
+ * device qualifies, which is what a device missing from HomeKit needs — the ones with no representation at
20
+ * all are exactly the subject there.
21
+ */
22
+ const affected = {
23
+ 'control-state': (device) => device.controllable,
24
+ 'live-media': (device) => device.representation.includes('camera.streaming'),
25
+ 'hksv-recording': (device) => device.representation.includes('camera.streaming'),
26
+ };
27
+
28
+ function affectable(profile, devices) {
29
+ return devices.filter(affected[profile] ?? (() => true));
13
30
  }
14
31
 
15
- function answer(state, matches) {
16
- if (matches) {
17
- return { ...state, mode: 'frequency', profile: questions[state.questionIndex].profile };
18
- }
19
- if (state.questionIndex === questions.length - 1) {
20
- return { ...state, mode: 'frequency', profile: 'other' };
21
- }
22
- return { ...state, questionIndex: state.questionIndex + 1 };
32
+ function start() {
33
+ return { mode: 'tiles', profile: undefined };
23
34
  }
24
35
 
25
- function direct() {
26
- return { mode: 'direct', questionIndex: 0, profile: undefined, source: 'direct' };
36
+ function select(state, profile) {
37
+ return { ...state, mode: deviceProfiles.includes(profile) ? 'devices' : 'frequency', profile };
27
38
  }
28
39
 
29
- function selectDirect(state, profile) {
30
- return { ...state, mode: 'frequency', profile, source: 'direct' };
40
+ function chooseDevices(state, devices) {
41
+ return { ...state, mode: 'frequency', devices };
31
42
  }
32
43
 
33
- function reject(state) {
34
- return state.source === 'direct' ? direct() : start();
44
+ function reject() {
45
+ return start();
35
46
  }
36
47
 
37
48
  function chooseReproductionMode(state, reproductionMode) {
@@ -39,7 +50,7 @@
39
50
  }
40
51
 
41
52
  function backFromFrequency(state) {
42
- return state.source === 'direct' ? direct() : start();
53
+ return deviceProfiles.includes(state.profile) ? { ...state, mode: 'devices' } : start();
43
54
  }
44
55
 
45
56
  function screen(session, startingAnother) {
@@ -54,15 +65,16 @@
54
65
  }
55
66
 
56
67
  global.HomebridgeEufyDiagnosticsWizard = {
57
- answer,
68
+ affectable,
58
69
  backFromFrequency,
59
70
  backgroundActive,
71
+ chooseDevices,
60
72
  chooseReproductionMode,
61
- direct,
62
- questions,
73
+ deviceProfiles,
74
+ profiles,
63
75
  reject,
64
76
  screen,
65
- selectDirect,
77
+ select,
66
78
  start,
67
79
  };
68
80
  })(window);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Homebridge Eufy",
3
3
  "name": "@homebridge-plugins/homebridge-eufy-security",
4
- "version": "5.0.0-beta.1",
4
+ "version": "5.0.0-beta.10",
5
5
  "description": "Control Eufy Security from homebridge.",
6
6
  "type": "module",
7
7
  "license": "Apache-2.0",
@@ -47,7 +47,7 @@
47
47
  ],
48
48
  "dependencies": {
49
49
  "@homebridge/plugin-ui-utils": "^2.2.6",
50
- "@mega-yfue/eufy-sdk": "0.1.0",
50
+ "@mega-yfue/eufy-sdk": "0.2.0-beta.12",
51
51
  "ffmpeg-for-homebridge": "2.2.2"
52
52
  },
53
53
  "devDependencies": {