eufy-security-client 3.6.0 → 3.7.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 (74) hide show
  1. package/.prettierignore/342/200/216 +8 -0
  2. package/.prettierrc +11 -0
  3. package/README.md +18 -0
  4. package/a.ts +61 -0
  5. package/build/error.js.map +1 -1
  6. package/build/eufysecurity.d.ts +1 -0
  7. package/build/eufysecurity.js +721 -224
  8. package/build/eufysecurity.js.map +1 -1
  9. package/build/http/api.d.ts +29 -0
  10. package/build/http/api.js +991 -701
  11. package/build/http/api.js.map +1 -1
  12. package/build/http/cache.js.map +1 -1
  13. package/build/http/const.d.ts +6 -1
  14. package/build/http/const.js +2044 -7536
  15. package/build/http/const.js.map +1 -1
  16. package/build/http/device.d.ts +4 -0
  17. package/build/http/device.js +1325 -440
  18. package/build/http/device.js.map +1 -1
  19. package/build/http/error.js.map +1 -1
  20. package/build/http/index.js.map +1 -1
  21. package/build/http/interfaces.d.ts +22 -15
  22. package/build/http/models.d.ts +2 -1
  23. package/build/http/parameter.js +74 -63
  24. package/build/http/parameter.js.map +1 -1
  25. package/build/http/station.d.ts +20 -2
  26. package/build/http/station.js +8639 -3566
  27. package/build/http/station.js.map +1 -1
  28. package/build/http/types.d.ts +12 -0
  29. package/build/http/types.js +297 -155
  30. package/build/http/types.js.map +1 -1
  31. package/build/http/utils.d.ts +16 -6
  32. package/build/http/utils.js +335 -208
  33. package/build/http/utils.js.map +1 -1
  34. package/build/index.js.map +1 -1
  35. package/build/interfaces.d.ts +4 -3
  36. package/build/logging.js +8 -13
  37. package/build/logging.js.map +1 -1
  38. package/build/mqtt/interface.d.ts +2 -2
  39. package/build/mqtt/service.js +12 -3
  40. package/build/mqtt/service.js.map +1 -1
  41. package/build/p2p/ble.js +7 -6
  42. package/build/p2p/ble.js.map +1 -1
  43. package/build/p2p/error.js.map +1 -1
  44. package/build/p2p/interfaces.d.ts +41 -6
  45. package/build/p2p/session.js +1484 -383
  46. package/build/p2p/session.js.map +1 -1
  47. package/build/p2p/talkback.js.map +1 -1
  48. package/build/p2p/types.js +36 -36
  49. package/build/p2p/types.js.map +1 -1
  50. package/build/p2p/utils.d.ts +10 -0
  51. package/build/p2p/utils.js +183 -90
  52. package/build/p2p/utils.js.map +1 -1
  53. package/build/push/client.js +15 -4
  54. package/build/push/client.js.map +1 -1
  55. package/build/push/error.js.map +1 -1
  56. package/build/push/interfaces.d.ts +8 -8
  57. package/build/push/models.js.map +1 -1
  58. package/build/push/parser.js +6 -2
  59. package/build/push/parser.js.map +1 -1
  60. package/build/push/service.js +214 -85
  61. package/build/push/service.js.map +1 -1
  62. package/build/push/types.js.map +1 -1
  63. package/build/push/utils.js.map +1 -1
  64. package/build/utils.js +7 -15
  65. package/build/utils.js.map +1 -1
  66. package/coverage/clover.xml +11133 -13648
  67. package/coverage/coverage-final.json +20 -30
  68. package/coverage/lcov-report/error.ts.html +3 -3
  69. package/coverage/lcov-report/index.html +50 -65
  70. package/coverage/lcov-report/logging.ts.html +598 -0
  71. package/coverage/lcov.info +21072 -25751
  72. package/dont-care.js +101 -0
  73. package/package.json +9 -5
  74. package/build/package.json +0 -81
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/http/error.ts"],"names":[],"mappings":";;;AAAA,oCAA+C;AAE/C,MAAa,oBAAqB,SAAQ,iBAAS;IAC/C,YAAY,OAAe,EAAE,UAAiD,EAAE;QAC5E,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC,IAAI,CAAC;IAC1C,CAAC;CACJ;AAND,oDAMC;AAED,MAAa,6BAA8B,SAAQ,iBAAS;IACxD,YAAY,OAAe,EAAE,UAAiD,EAAE;QAC5E,KAAK,CAAC,OAAO,EAAE,OAAO,CA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AC9E,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC;IACtC,CAAC;CACF;AAND,gDAMC;AAED,MAAa,cAAe,SAAQ,iBAAS;IAC3C,YAAY,OAAe,EAAE,UAAiD,EAAE;QAC9E,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;IAClC,CAAC;CACF;AAND,wCAMC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,0CAAwB;AACxB,2CAAyB;AACzB,+CAA6B;AAC7B,2CAAyB;AACzB,8CAA4B;AAC5B,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,iCAAuE;AAA9D,iHAAA,wBAAwB,OAAA;AAAE,4GAAA,mBAAmB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,0CAAwB;AACxB,2CAAyB;AACzB,+CAA6B;AAC7B,2CAAyB;AACzB,8CAA4B;AAC5B,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,iCAAwE;AAA/D,iHAAA,wBAAwB,OAAA;AAAE,4GAAA,mBAAmB,OAAA"}
@@ -5,7 +5,7 @@ import type { Method } from "got" with {
5
5
  import type { ImageFileExtension } from "image-type" with {
6
6
  "resolution-mode": "import"
7
7
  };
8
- import { DatabaseCountByDate, DatabaseQueryLatestInfo, DatabaseQueryLocal, StreamMetadata } from "../p2p/interfaces";
8
+ import { DatabaseCountByDate, DatabaseQueryByDate, DatabaseQueryLatestInfo, DatabaseQueryLocal, StreamMetadata } from "../p2p/interfaces";
9
9
  import { CommandResult, StorageInfoBodyHB3 } from "../p2p/models";
10
10
  import { AlarmEvent, DatabaseReturnCode, SmartSafeAlarm911Event, SmartSafeShakeAlarmEvent, TFCardStatus } from "../p2p/types";
11
11
  import { Camera, Device } from "./device";
@@ -147,19 +147,19 @@ export interface Picture {
147
147
  type: ImageType;
148
148
  }
149
149
  export interface HTTPApiEvents {
150
- "devices": (devices: FullDevices) => void;
151
- "hubs": (hubs: Hubs) => void;
152
- "houses": (houses: Houses) => void;
153
- "connect": () => void;
154
- "close": () => void;
150
+ devices: (devices: FullDevices) => void;
151
+ hubs: (hubs: Hubs) => void;
152
+ houses: (houses: Houses) => void;
153
+ connect: () => void;
154
+ close: () => void;
155
155
  "connection error": (error: Error) => void;
156
156
  "tfa request": () => void;
157
157
  "captcha request": (id: string, captcha: string) => void;
158
158
  "auth token invalidated": () => void;
159
159
  }
160
160
  export interface StationEvents {
161
- "connect": (station: Station) => void;
162
- "close": (station: Station) => void;
161
+ connect: (station: Station) => void;
162
+ close: (station: Station) => void;
163
163
  "connection error": (station: Station, error: Error) => void;
164
164
  "raw device property changed": (deviceSN: string, params: RawValues) => void;
165
165
  "property changed": (station: Station, name: string, value: PropertyValue, ready: boolean) => void;
@@ -176,7 +176,7 @@ export interface StationEvents {
176
176
  "guard mode": (station: Station, guardMode: number) => void;
177
177
  "current mode": (station: Station, currentMode: number) => void;
178
178
  "alarm event": (station: Station, alarmEvent: AlarmEvent) => void;
179
- "ready": (station: Station) => void;
179
+ ready: (station: Station) => void;
180
180
  "runtime state": (station: Station, channel: number, batteryLevel: number, temperature: number) => void;
181
181
  "charging state": (station: Station, channel: number, chargeType: number, batteryLevel: number) => void;
182
182
  "wifi rssi": (station: Station, channel: number, rssi: number) => void;
@@ -198,6 +198,7 @@ export interface StationEvents {
198
198
  "image download": (station: Station, file: string, image: Buffer) => void;
199
199
  "database query latest": (station: Station, returnCode: DatabaseReturnCode, data: Array<DatabaseQueryLatestInfo>) => void;
200
200
  "database query local": (station: Station, returnCode: DatabaseReturnCode, data: Array<DatabaseQueryLocal>) => void;
201
+ "database query by date": (station: Station, returnCode: DatabaseReturnCode, data: Array<DatabaseQueryByDate>) => void;
201
202
  "database count by date": (station: Station, returnCode: DatabaseReturnCode, data: Array<DatabaseCountByDate>) => void;
202
203
  "database delete": (station: Station, returnCode: DatabaseReturnCode, failedIds: Array<unknown>) => void;
203
204
  "sensor status": (station: Station, channel: number, status: number) => void;
@@ -217,10 +218,10 @@ export interface DeviceEvents {
217
218
  "dog lick detected": (device: Device, state: boolean) => void;
218
219
  "dog poop detected": (device: Device, state: boolean) => void;
219
220
  "stranger person detected": (device: Device, state: boolean) => void;
220
- "rings": (device: Device, state: boolean) => void;
221
- "locked": (device: Device, state: boolean) => void;
222
- "open": (device: Device, state: boolean) => void;
223
- "ready": (device: Device) => void;
221
+ rings: (device: Device, state: boolean) => void;
222
+ locked: (device: Device, state: boolean) => void;
223
+ open: (device: Device, state: boolean) => void;
224
+ ready: (device: Device) => void;
224
225
  "package delivered": (device: Device, state: boolean) => void;
225
226
  "package stranded": (device: Device, state: boolean) => void;
226
227
  "package taken": (device: Device, state: boolean) => void;
@@ -231,11 +232,17 @@ export interface DeviceEvents {
231
232
  "wrong try-protect alarm": (device: Device, state: boolean) => void;
232
233
  "long time not close": (device: Device, state: boolean) => void;
233
234
  "low battery": (device: Device, state: boolean) => void;
234
- "jammed": (device: Device, state: boolean) => void;
235
- "tampering": (device: Device, state: boolean) => void;
235
+ jammed: (device: Device, state: boolean) => void;
236
+ tampering: (device: Device, state: boolean) => void;
236
237
  "low temperature": (device: Device, state: boolean) => void;
237
238
  "high temperature": (device: Device, state: boolean) => void;
238
239
  "pin incorrect": (device: Device, state: boolean) => void;
239
240
  "lid stuck": (device: Device, state: boolean) => void;
240
241
  "battery fully charged": (device: Device, state: boolean) => void;
241
242
  }
243
+ export interface BrandData {
244
+ first?: string[];
245
+ second?: string[];
246
+ numbers?: number;
247
+ letters?: string[];
248
+ }
@@ -382,6 +382,7 @@ export interface Cipher {
382
382
  cipher_id: number;
383
383
  user_id: string;
384
384
  private_key: string;
385
+ ecc_private_key?: string;
385
386
  }
386
387
  export interface Voice {
387
388
  voice_id: number;
@@ -595,7 +596,7 @@ export interface FloodlightDetectionRangeT8425Property {
595
596
  }
596
597
  export interface FloodlightLightSettingsBrightnessScheduleT8425Property {
597
598
  sunset2rise: number;
598
- longtitude: string;
599
+ longitude: string;
599
600
  latitude: string;
600
601
  brightness: number;
601
602
  schedule: Array<unknown>;
@@ -1,81 +1,87 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ParameterHelper = void 0;
4
- const types_1 = require("../p2p/types");
4
+ const p2p_1 = require("../p2p");
5
5
  const utils_1 = require("../p2p/utils");
6
6
  const utils_2 = require("../utils");
7
- const types_2 = require("./types");
7
+ const types_1 = require("./types");
8
8
  const utils_3 = require("./utils");
9
9
  const error_1 = require("../error");
10
10
  class ParameterHelper {
11
11
  static JSON_PARSE_BASE64_PARAMS = new Set([
12
- types_2.ParamType.SNOOZE_MODE,
13
- types_2.ParamType.CAMERA_MOTION_ZONES,
14
- types_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN_DELAY,
15
- types_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN,
16
- types_1.CommandType.ARM_DELAY_HOME,
17
- types_1.CommandType.ARM_DELAY_AWAY,
18
- types_1.CommandType.ARM_DELAY_CUS1,
19
- types_1.CommandType.ARM_DELAY_CUS2,
20
- types_1.CommandType.ARM_DELAY_CUS3,
21
- types_1.CommandType.ARM_DELAY_OFF,
22
- types_1.CommandType.CELLULAR_INFO,
23
- types_1.CommandType.CMD_WALL_LIGHT_SETTINGS_MANUAL_COLORED_LIGHTING,
24
- types_1.CommandType.CMD_WALL_LIGHT_SETTINGS_SCHEDULE_COLORED_LIGHTING,
25
- types_1.CommandType.CMD_WALL_LIGHT_SETTINGS_COLORED_LIGHTING_COLORS,
26
- types_1.CommandType.CMD_WALL_LIGHT_SETTINGS_DYNAMIC_LIGHTING_THEMES,
27
- types_1.CommandType.CMD_INDOOR_DET_SET_ACTIVE_ZONE,
28
- types_1.CommandType.CMD_SET_PRIVACYPARAM,
29
- types_1.CommandType.CMD_BAT_DOORBELL_VIDEO_QUALITY2,
30
- types_1.CommandType.CMD_BAT_DOORBELL_RECORD_QUALITY2,
31
- types_1.CommandType.CMD_SET_CROSS_TRACKING_CAMERA_LIST,
32
- types_1.CommandType.CMD_SET_CROSS_TRACKING_GROUP_LIST,
33
- types_1.CommandType.CMD_FLOODLIGHT_SET_DETECTION_RANGE_T8425,
34
- types_1.CommandType.CMD_SET_LIGHT_CTRL_BRIGHT_PIR_T8425,
35
- types_1.CommandType.CMD_SET_LIGHT_CTRL_BRIGHT_SCH_T8425
12
+ types_1.ParamType.SNOOZE_MODE,
13
+ types_1.ParamType.CAMERA_MOTION_ZONES,
14
+ p2p_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN_DELAY,
15
+ p2p_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN,
16
+ p2p_1.CommandType.ARM_DELAY_HOME,
17
+ p2p_1.CommandType.ARM_DELAY_AWAY,
18
+ p2p_1.CommandType.ARM_DELAY_CUS1,
19
+ p2p_1.CommandType.ARM_DELAY_CUS2,
20
+ p2p_1.CommandType.ARM_DELAY_CUS3,
21
+ p2p_1.CommandType.ARM_DELAY_OFF,
22
+ p2p_1.CommandType.CELLULAR_INFO,
23
+ p2p_1.CommandType.CMD_WALL_LIGHT_SETTINGS_MANUAL_COLORED_LIGHTING,
24
+ p2p_1.CommandType.CMD_WALL_LIGHT_SETTINGS_SCHEDULE_COLORED_LIGHTING,
25
+ p2p_1.CommandType.CMD_WALL_LIGHT_SETTINGS_COLORED_LIGHTING_COLORS,
26
+ p2p_1.CommandType.CMD_WALL_LIGHT_SETTINGS_DYNAMIC_LIGHTING_THEMES,
27
+ p2p_1.CommandType.CMD_INDOOR_DET_SET_ACTIVE_ZONE,
28
+ p2p_1.CommandType.CMD_SET_PRIVACYPARAM,
29
+ p2p_1.CommandType.CMD_BAT_DOORBELL_VIDEO_QUALITY2,
30
+ p2p_1.CommandType.CMD_BAT_DOORBELL_RECORD_QUALITY2,
31
+ p2p_1.CommandType.CMD_SET_CROSS_TRACKING_CAMERA_LIST,
32
+ p2p_1.CommandType.CMD_SET_CROSS_TRACKING_GROUP_LIST,
33
+ p2p_1.CommandType.CMD_FLOODLIGHT_SET_DETECTION_RANGE_T8425,
34
+ p2p_1.CommandType.CMD_SET_LIGHT_CTRL_BRIGHT_PIR_T8425,
35
+ p2p_1.CommandType.CMD_SET_LIGHT_CTRL_BRIGHT_SCH_T8425,
36
36
  ]);
37
37
  static JSON_PARSE_PLAIN_PARAMS = new Set([
38
- types_1.CommandType.CMD_BAT_DOORBELL_SET_NOTIFICATION_MODE,
39
- types_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_DETECTION_SENSITIVITY,
40
- types_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_AUTO_RESPONSE,
41
- types_1.CommandType.CMD_DOORBELL_DUAL_PACKAGE_STRAND_TIME,
42
- types_1.CommandType.CMD_DOORBELL_DUAL_RING_AUTO_RESPONSE,
43
- types_1.CommandType.CMD_DOORBELL_DUAL_PACKAGE_GUARD_TIME,
44
- types_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_DISTANCE,
45
- types_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_TIME,
46
- types_1.CommandType.CMD_DOORBELL_DUAL_DELIVERY_GUARD_SWITCH,
47
- types_1.CommandType.CMD_DOORBELL_DUAL_PACKAGE_GUARD_VOICE,
48
- types_1.CommandType.CMD_CAMERA_GARAGE_DOOR_SENSORS,
49
- types_1.CommandType.CMD_MOTION_SET_LEAVING_REACTIONS
38
+ p2p_1.CommandType.CMD_BAT_DOORBELL_SET_NOTIFICATION_MODE,
39
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_DETECTION_SENSITIVITY,
40
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_AUTO_RESPONSE,
41
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_PACKAGE_STRAND_TIME,
42
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_RING_AUTO_RESPONSE,
43
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_PACKAGE_GUARD_TIME,
44
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_DISTANCE,
45
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_TIME,
46
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_DELIVERY_GUARD_SWITCH,
47
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_PACKAGE_GUARD_VOICE,
48
+ p2p_1.CommandType.CMD_CAMERA_GARAGE_DOOR_SENSORS,
49
+ p2p_1.CommandType.CMD_MOTION_SET_LEAVING_REACTIONS,
50
50
  ]);
51
51
  static readValue(serialNumber, type, value, log) {
52
52
  if (value) {
53
+ // TODO: investigate why the value can be a object
54
+ //
55
+ //if (typeof value !== "string") return value;
56
+ if (typeof value !== "string") {
57
+ log.debug("Watch out for this object! .", {
58
+ value: JSON.stringify(value, null, 2)
59
+ });
60
+ return value;
61
+ }
53
62
  if (ParameterHelper.JSON_PARSE_BASE64_PARAMS.has(type)) {
54
- if (typeof value === "string") {
55
- const parsedValue = (0, utils_2.parseJSON)((0, utils_1.getNullTerminatedString)((0, utils_1.decodeBase64)(value), "utf-8"), log);
56
- if (parsedValue === undefined) {
57
- log.debug("Non-parsable parameter value received from eufy cloud. Will be ignored.", { serialNumber: serialNumber, type: type, value: value });
58
- }
59
- return parsedValue;
60
- }
61
- else {
62
- return value; //return object
63
+ const parsedValue = (0, utils_2.parseJSON)((0, utils_1.getNullTerminatedString)((0, utils_1.decodeBase64)(value), "utf-8"), log);
64
+ if (parsedValue === undefined) {
65
+ log.debug("Non-parsable parameter value received from eufy cloud. Will be ignored.", {
66
+ serialNumber: serialNumber,
67
+ type: type,
68
+ value: value,
69
+ });
63
70
  }
71
+ return parsedValue;
64
72
  }
65
73
  else if (ParameterHelper.JSON_PARSE_PLAIN_PARAMS.has(type)) {
66
- if (typeof value === "string") {
67
- const parsedValue = (0, utils_2.parseJSON)(value, log);
68
- if (parsedValue === undefined) {
69
- log.debug("Non-parsable parameter value received from eufy cloud. Will be ignored.", { serialNumber: serialNumber, type: type, value: value });
70
- }
71
- return parsedValue;
72
- }
73
- else {
74
- return value; //return object
74
+ const parsedValue = (0, utils_2.parseJSON)(value, log);
75
+ if (parsedValue === undefined) {
76
+ log.debug("Non-parsable parameter value received from eufy cloud. Will be ignored.", {
77
+ serialNumber: serialNumber,
78
+ type: type,
79
+ value: value,
80
+ });
75
81
  }
82
+ return parsedValue;
76
83
  }
77
- else if (type === types_1.TrackerCommandType.COMMAND_NEW_LOCATION ||
78
- type === types_1.TrackerCommandType.LOCATION_NEW_ADDRESS) {
84
+ else if (type === p2p_1.TrackerCommandType.COMMAND_NEW_LOCATION || type === p2p_1.TrackerCommandType.LOCATION_NEW_ADDRESS) {
79
85
  try {
80
86
  const decrypted = (0, utils_3.decryptTrackerData)(Buffer.from(value, "hex"), Buffer.from(serialNumber));
81
87
  if (decrypted !== undefined) {
@@ -84,7 +90,12 @@ class ParameterHelper {
84
90
  }
85
91
  catch (err) {
86
92
  const error = (0, error_1.ensureError)(err);
87
- log.debug("Non-parsable parameter value received from eufy cloud. Will be ignored.", { serialNumber: serialNumber, type: type, value: value, error: (0, utils_2.getError)(error) });
93
+ log.debug("Non-parsable parameter value received from eufy cloud. Will be ignored.", {
94
+ serialNumber: serialNumber,
95
+ type: type,
96
+ value: value,
97
+ error: (0, utils_2.getError)(error),
98
+ });
88
99
  }
89
100
  return "";
90
101
  }
@@ -93,10 +104,10 @@ class ParameterHelper {
93
104
  }
94
105
  static writeValue(type, value) {
95
106
  if (value) {
96
- if (type === types_2.ParamType.SNOOZE_MODE ||
97
- type === types_2.ParamType.CAMERA_MOTION_ZONES ||
98
- type === types_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN_DELAY ||
99
- type === types_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN) {
107
+ if (type === types_1.ParamType.SNOOZE_MODE ||
108
+ type === types_1.ParamType.CAMERA_MOTION_ZONES ||
109
+ type === p2p_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN_DELAY ||
110
+ type === p2p_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN) {
100
111
  return Buffer.from(JSON.stringify(value)).toString("base64");
101
112
  }
102
113
  return value;
@@ -1 +1 @@
1
- {"version":3,"file":"parameter.js","sourceRoot":"","sources":["../../src/http/parameter.ts"],"names":[],"mappings":";;;AAEA,wCAA+D;AAC/D,wCAAqE;AACrE,oCAA+C;AAC/C,mCAAoC;AACpC,mCAA6C;AAC7C,oCAAuC;AAEvC,MAAa,eAAe;IAEhB,MAAM,CAAU,wBAAwB,GAAG,IAAI,GAAG,CAAS;QAC/D,iBAAS,CAAC,WAAW;QACrB,iBAAS,CAAC,mBAAmB;QAC7B,mBAAW,CAAC,oCAAoC;QAChD,mBAAW,CAAC,8BAA8B;QAC1C,mBAAW,CAAC,cAAc;QAC1B,mBAAW,CAAC,cAAc;QAC1B,mBAAW,CAAC,cAAc;QAC1B,mBAAW,CAAC,cAAc;QAC1B,mBAAW,CAAC,cAAc;QAC1B,mBAAW,CAAC,aAAa;QACzB,mBAAW,CAAC,aAAa;QACzB,mBAAW,CAAC,+CAA+C;QAC3D,mBAAW,CAAC,iDAAiD;QAC7D,mBAAW,CAAC,+CAA+C;QAC3D,mBAAW,CAAC,+CAA+C;QAC3D,mBAAW,CAAC,8BAA8B;QAC1C,mBAAW,CAAC,oBAA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BACnF,YAAY,EAAE,YAAY;wBAC1B,IAAI,EAAE,IAAI;wBACV,KAAK,EAAE,KAAK;wBACZ,KAAK,EAAE,IAAA,gBAAQ,EAAC,KAAK,CAAC;qBACvB,CAAC,CAAC;gBACL,CAAC;gBACD,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,IAAY,EAAE,KAAa;QAClD,IAAI,KAAK,EAAE,CAAC;YACV,IACE,IAAI,KAAK,iBAAS,CAAC,WAAW;gBAC9B,IAAI,KAAK,iBAAS,CAAC,mBAAmB;gBACtC,IAAI,KAAK,iBAAW,CAAC,oCAAoC;gBACzD,IAAI,KAAK,iBAAW,CAAC,8BAA8B,EACnD,CAAC;gBACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAC/D,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;;AA7GH,0CA8GC"}
@@ -1,6 +1,6 @@
1
1
  import { TypedEmitter } from "tiny-typed-emitter";
2
2
  import { HTTPApi } from "./api";
3
- import { AlarmTone, NotificationSwitchMode, DeviceType, FloodlightMotionTriggeredDistance, GuardMode, NotificationType, PowerSource, PropertyName, TimeFormat, CommandName, VideoTypeStoreToNAS, HB3DetectionTypes, WalllightNotificationType, DailyLightingType, MotionActivationMode, LightingActiveMode, SourceType, T8170DetectionTypes, IndoorS350NotificationTypes, SoloCameraDetectionTypes, MotionDetectionRangeType, ViewModeType, FloodlightT8425NotificationTypes, PresetPositionType, IndoorS350DetectionTypes } from "./types";
3
+ import { AlarmTone, NotificationSwitchMode, DeviceType, FloodlightMotionTriggeredDistance, GuardMode, NotificationType, PowerSource, PropertyName, TimeFormat, CommandName, VideoTypeStoreToNAS, HB3DetectionTypes, WalllightNotificationType, DailyLightingType, MotionActivationMode, LightingActiveMode, SourceType, T8170DetectionTypes, IndoorS350NotificationTypes, SoloCameraDetectionTypes, MotionDetectionRangeType, ViewModeType, FloodlightT8425NotificationTypes, PresetPositionType, IndoorS350DetectionTypes, EufyCamC35DetectionTypes } from "./types";
4
4
  import { SnoozeDetail, StationListResponse } from "./models";
5
5
  import { IndexedProperty, PropertyMetadataAny, PropertyValue, PropertyValues, RawValues, StationEvents, Schedule } from "./interfaces";
6
6
  import { CrossTrackingGroupEntry, DynamicLighting, MotionZone, RGBColor } from "../p2p/interfaces";
@@ -48,9 +48,25 @@ export declare class Station extends TypedEmitter<StationEvents> {
48
48
  static getChannel(type: number): number;
49
49
  static isStation(type: number): boolean;
50
50
  isStation(): boolean;
51
+ static isStationHomeBase2OrOlder(type: number): boolean;
51
52
  static isStationHomeBase3(type: number): boolean;
53
+ static isStationHomeBaseMini(type: number): boolean;
52
54
  static isStationHomeBase3BySn(sn: string): boolean;
55
+ static isStationHomeBaseMiniBySn(sn: string): boolean;
56
+ isStationHomeBase2OrOlder(): boolean;
53
57
  isStationHomeBase3(): boolean;
58
+ isStationHomeBaseMini(): boolean;
59
+ /**
60
+ * Checks if the station is a HomeBase 3 or HomeBase mini for determining if SoloDevices are connected to a supported HomeBase.
61
+ * @returns Returns true, if this is a HomeBase 3 or a HomeBase mini, otherwise false.
62
+ */
63
+ isDeviceControlledByHomeBase(): boolean;
64
+ /**
65
+ * Checks if the station is a HomeBase 3 or HomeBase mini for determining if SoloDevices are connected to a supported HomeBase The check will be done by the given serial number.
66
+ * @param sn The serial of the station to check.
67
+ * @returns Returns true, if this is a HomeBase 3 or a HomeBase mini, otherwise false.
68
+ */
69
+ static isDeviceControlledByHomeBaseBySn(sn: string): boolean;
54
70
  isIntegratedDevice(): boolean;
55
71
  isP2PConnectableDevice(): boolean;
56
72
  getDeviceType(): number;
@@ -111,7 +127,7 @@ export declare class Station extends TypedEmitter<StationEvents> {
111
127
  switchLight(device: Device, value: boolean): void;
112
128
  setMotionDetectionSensitivity(device: Device, value: number): void;
113
129
  setMotionDetectionType(device: Device, value: number): void;
114
- setMotionDetectionTypeHB3(device: Device, type: HB3DetectionTypes | T8170DetectionTypes | SoloCameraDetectionTypes | IndoorS350DetectionTypes, value: boolean): void;
130
+ setMotionDetectionTypeHB3(device: Device, type: HB3DetectionTypes | T8170DetectionTypes | SoloCameraDetectionTypes | IndoorS350DetectionTypes | EufyCamC35DetectionTypes, value: boolean): void;
115
131
  setMotionZone(device: Device, value: MotionZone): void;
116
132
  setMotionTracking(device: Device, value: boolean): void;
117
133
  setPanAndTiltRotationSpeed(device: Device, value: number): void;
@@ -305,10 +321,12 @@ export declare class Station extends TypedEmitter<StationEvents> {
305
321
  private onTFCardStatus;
306
322
  databaseQueryLatestInfo(failureCallback?: () => void): void;
307
323
  databaseQueryLocal(serialNumbers: Array<string>, startDate: Date, endDate: Date, eventType?: FilterEventType, detectionType?: FilterDetectType, storageType?: FilterStorageType): void;
324
+ databaseQueryByDate(serialNumbers: Array<string>, startDate: Date, endDate: Date, eventType?: FilterEventType, detectionType?: FilterDetectType, storageType?: FilterStorageType): void;
308
325
  databaseDelete(ids: Array<number>): void;
309
326
  databaseCountByDate(startDate: Date, endDate: Date): void;
310
327
  private onDatabaseQueryLatest;
311
328
  private onDatabaseQueryLocal;
329
+ private onDatabaseQueryByDate;
312
330
  private onDatabaseCountByDate;
313
331
  private onDatabaseDelete;
314
332
  private onSensorStatus;