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.
- package/.prettierignore/342/200/216 +8 -0
- package/.prettierrc +11 -0
- package/README.md +18 -0
- package/a.ts +61 -0
- package/build/error.js.map +1 -1
- package/build/eufysecurity.d.ts +1 -0
- package/build/eufysecurity.js +721 -224
- package/build/eufysecurity.js.map +1 -1
- package/build/http/api.d.ts +29 -0
- package/build/http/api.js +991 -701
- package/build/http/api.js.map +1 -1
- package/build/http/cache.js.map +1 -1
- package/build/http/const.d.ts +6 -1
- package/build/http/const.js +2044 -7536
- package/build/http/const.js.map +1 -1
- package/build/http/device.d.ts +4 -0
- package/build/http/device.js +1325 -440
- package/build/http/device.js.map +1 -1
- package/build/http/error.js.map +1 -1
- package/build/http/index.js.map +1 -1
- package/build/http/interfaces.d.ts +22 -15
- package/build/http/models.d.ts +2 -1
- package/build/http/parameter.js +74 -63
- package/build/http/parameter.js.map +1 -1
- package/build/http/station.d.ts +20 -2
- package/build/http/station.js +8639 -3566
- package/build/http/station.js.map +1 -1
- package/build/http/types.d.ts +12 -0
- package/build/http/types.js +297 -155
- package/build/http/types.js.map +1 -1
- package/build/http/utils.d.ts +16 -6
- package/build/http/utils.js +335 -208
- package/build/http/utils.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/interfaces.d.ts +4 -3
- package/build/logging.js +8 -13
- package/build/logging.js.map +1 -1
- package/build/mqtt/interface.d.ts +2 -2
- package/build/mqtt/service.js +12 -3
- package/build/mqtt/service.js.map +1 -1
- package/build/p2p/ble.js +7 -6
- package/build/p2p/ble.js.map +1 -1
- package/build/p2p/error.js.map +1 -1
- package/build/p2p/interfaces.d.ts +41 -6
- package/build/p2p/session.js +1484 -383
- package/build/p2p/session.js.map +1 -1
- package/build/p2p/talkback.js.map +1 -1
- package/build/p2p/types.js +36 -36
- package/build/p2p/types.js.map +1 -1
- package/build/p2p/utils.d.ts +10 -0
- package/build/p2p/utils.js +183 -90
- package/build/p2p/utils.js.map +1 -1
- package/build/push/client.js +15 -4
- package/build/push/client.js.map +1 -1
- package/build/push/error.js.map +1 -1
- package/build/push/interfaces.d.ts +8 -8
- package/build/push/models.js.map +1 -1
- package/build/push/parser.js +6 -2
- package/build/push/parser.js.map +1 -1
- package/build/push/service.js +214 -85
- package/build/push/service.js.map +1 -1
- package/build/push/types.js.map +1 -1
- package/build/push/utils.js.map +1 -1
- package/build/utils.js +7 -15
- package/build/utils.js.map +1 -1
- package/coverage/clover.xml +11133 -13648
- package/coverage/coverage-final.json +20 -30
- package/coverage/lcov-report/error.ts.html +3 -3
- package/coverage/lcov-report/index.html +50 -65
- package/coverage/lcov-report/logging.ts.html +598 -0
- package/coverage/lcov.info +21072 -25751
- package/dont-care.js +101 -0
- package/package.json +9 -5
- package/build/package.json +0 -81
package/build/http/device.js
CHANGED
|
@@ -46,7 +46,9 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
46
46
|
const metadata = this.getPropertiesMetadata(true);
|
|
47
47
|
for (const property of Object.values(metadata)) {
|
|
48
48
|
if (this.rawDevice[property.key] !== undefined && typeof property.key === "string") {
|
|
49
|
-
if (property.key === "cover_path" &&
|
|
49
|
+
if (property.key === "cover_path" &&
|
|
50
|
+
!this.getPropertyValue(property.name) &&
|
|
51
|
+
this.rawDevice[property.key] !== "") {
|
|
50
52
|
// First image initialisation if no image has been set yet and a cloud value is available
|
|
51
53
|
this.updateProperty(property.name, this.convertRawPropertyValue(property, (0, utils_1.getImagePath)(this.rawDevice[property.key])));
|
|
52
54
|
}
|
|
@@ -59,15 +61,16 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
if (this.rawDevice.params) {
|
|
62
|
-
this.rawDevice.params.forEach(param => {
|
|
64
|
+
this.rawDevice.params.forEach((param) => {
|
|
63
65
|
this.updateRawProperty(param.param_type, param.param_value, "http");
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
68
|
logging_1.rootHTTPLogger.debug("Update device cloud properties", { deviceSN: this.getSerial(), properties: this.properties });
|
|
67
69
|
}
|
|
68
70
|
updateProperty(name, value, force = false) {
|
|
69
|
-
if ((this.properties[name] !== undefined && this.properties[name] !== value)
|
|
70
|
-
|
|
71
|
+
if ((this.properties[name] !== undefined && this.properties[name] !== value) ||
|
|
72
|
+
this.properties[name] === undefined ||
|
|
73
|
+
force) {
|
|
71
74
|
const oldValue = this.properties[name];
|
|
72
75
|
this.properties[name] = value;
|
|
73
76
|
this.emit("property changed", this, name, value, this.ready);
|
|
@@ -77,10 +80,22 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
77
80
|
catch (err) {
|
|
78
81
|
const error = (0, error_2.ensureError)(err);
|
|
79
82
|
if (error instanceof error_1.InvalidPropertyError) {
|
|
80
|
-
logging_1.rootHTTPLogger.error(`Device update property - Invalid Property error`, {
|
|
83
|
+
logging_1.rootHTTPLogger.error(`Device update property - Invalid Property error`, {
|
|
84
|
+
error: (0, utils_3.getError)(error),
|
|
85
|
+
deviceSN: this.getSerial(),
|
|
86
|
+
propertyName: name,
|
|
87
|
+
propertyValue: value,
|
|
88
|
+
force: force,
|
|
89
|
+
});
|
|
81
90
|
}
|
|
82
91
|
else {
|
|
83
|
-
logging_1.rootHTTPLogger.error(`Device update property - Property error`, {
|
|
92
|
+
logging_1.rootHTTPLogger.error(`Device update property - Property error`, {
|
|
93
|
+
error: (0, utils_3.getError)(error),
|
|
94
|
+
deviceSN: this.getSerial(),
|
|
95
|
+
propertyName: name,
|
|
96
|
+
propertyValue: value,
|
|
97
|
+
force: force,
|
|
98
|
+
});
|
|
84
99
|
}
|
|
85
100
|
}
|
|
86
101
|
return true;
|
|
@@ -88,18 +103,21 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
88
103
|
return false;
|
|
89
104
|
}
|
|
90
105
|
updateRawProperties(values) {
|
|
91
|
-
Object.keys(values).forEach(paramtype => {
|
|
106
|
+
Object.keys(values).forEach((paramtype) => {
|
|
92
107
|
const param_type = Number.parseInt(paramtype);
|
|
93
108
|
this.updateRawProperty(param_type, values[param_type].value, values[param_type].source);
|
|
94
109
|
});
|
|
95
110
|
}
|
|
96
111
|
handlePropertyChange(metadata, oldValue, newValue) {
|
|
97
112
|
try {
|
|
98
|
-
if ((metadata.key === types_1.ParamType.DETECT_MOTION_SENSITIVE || metadata.key === types_1.ParamType.DETECT_MODE) &&
|
|
113
|
+
if ((metadata.key === types_1.ParamType.DETECT_MOTION_SENSITIVE || metadata.key === types_1.ParamType.DETECT_MODE) &&
|
|
114
|
+
this.isWiredDoorbell()) {
|
|
99
115
|
//TODO: Not perfectly solved, can in certain cases briefly trigger a double event where the last event is the correct one
|
|
100
116
|
const rawSensitivity = this.getRawProperty(types_1.ParamType.DETECT_MOTION_SENSITIVE);
|
|
101
117
|
const rawMode = this.getRawProperty(types_1.ParamType.DETECT_MODE);
|
|
102
|
-
if (rawSensitivity !== undefined &&
|
|
118
|
+
if (rawSensitivity !== undefined &&
|
|
119
|
+
rawMode !== undefined &&
|
|
120
|
+
this.hasProperty(types_1.PropertyName.DeviceMotionDetectionSensitivity)) {
|
|
103
121
|
const sensitivity = Number.parseInt(rawSensitivity);
|
|
104
122
|
const mode = Number.parseInt(rawMode);
|
|
105
123
|
const sensitivityMapping = {
|
|
@@ -107,7 +125,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
107
125
|
"1_1": 2,
|
|
108
126
|
"1_2": 3,
|
|
109
127
|
"1_3": 4,
|
|
110
|
-
"2_1": 5
|
|
128
|
+
"2_1": 5,
|
|
111
129
|
};
|
|
112
130
|
const key = `${mode}_${sensitivity}`;
|
|
113
131
|
if (sensitivityMapping[key] !== undefined) {
|
|
@@ -115,25 +133,36 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
115
133
|
}
|
|
116
134
|
}
|
|
117
135
|
}
|
|
118
|
-
else if (metadata.name === types_1.PropertyName.DeviceWifiRSSI &&
|
|
136
|
+
else if (metadata.name === types_1.PropertyName.DeviceWifiRSSI &&
|
|
137
|
+
this.hasProperty(types_1.PropertyName.DeviceWifiSignalLevel)) {
|
|
119
138
|
this.updateProperty(types_1.PropertyName.DeviceWifiSignalLevel, (0, utils_1.calculateWifiSignalLevel)(this, newValue));
|
|
120
139
|
}
|
|
121
|
-
else if (metadata.name === types_1.PropertyName.DeviceCellularRSSI &&
|
|
140
|
+
else if (metadata.name === types_1.PropertyName.DeviceCellularRSSI &&
|
|
141
|
+
this.hasProperty(types_1.PropertyName.DeviceCellularSignalLevel)) {
|
|
122
142
|
this.updateProperty(types_1.PropertyName.DeviceCellularSignalLevel, (0, utils_1.calculateCellularSignalLevel)(newValue));
|
|
123
143
|
}
|
|
124
144
|
}
|
|
125
145
|
catch (err) {
|
|
126
146
|
const error = (0, error_2.ensureError)(err);
|
|
127
|
-
logging_1.rootHTTPLogger.error(`Device handle property change - error`, {
|
|
147
|
+
logging_1.rootHTTPLogger.error(`Device handle property change - error`, {
|
|
148
|
+
error: (0, utils_3.getError)(error),
|
|
149
|
+
deviceSN: this.getSerial(),
|
|
150
|
+
metadata: metadata,
|
|
151
|
+
oldValue: oldValue,
|
|
152
|
+
newValue: newValue,
|
|
153
|
+
});
|
|
128
154
|
}
|
|
129
155
|
}
|
|
130
156
|
updateRawProperty(type, value, source) {
|
|
131
157
|
const parsedValue = parameter_1.ParameterHelper.readValue(this.getStationSerial(), type, value, logging_1.rootHTTPLogger);
|
|
132
158
|
if (parsedValue !== undefined &&
|
|
133
|
-
((this.rawProperties[type] !== undefined &&
|
|
159
|
+
((this.rawProperties[type] !== undefined &&
|
|
160
|
+
this.rawProperties[type].value !== parsedValue &&
|
|
161
|
+
(0, utils_1.isPrioritySourceType)(this.rawProperties[type].source, source)) ||
|
|
162
|
+
this.rawProperties[type] === undefined)) {
|
|
134
163
|
this.rawProperties[type] = {
|
|
135
164
|
value: parsedValue,
|
|
136
|
-
source: source
|
|
165
|
+
source: source,
|
|
137
166
|
};
|
|
138
167
|
if (this.ready)
|
|
139
168
|
this.emit("raw property changed", this, type, this.rawProperties[type].value);
|
|
@@ -146,10 +175,22 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
146
175
|
catch (err) {
|
|
147
176
|
const error = (0, error_2.ensureError)(err);
|
|
148
177
|
if (error instanceof error_1.PropertyNotSupportedError) {
|
|
149
|
-
logging_1.rootHTTPLogger.debug("Device update raw property - Property not supported error", {
|
|
178
|
+
logging_1.rootHTTPLogger.debug("Device update raw property - Property not supported error", {
|
|
179
|
+
error: (0, utils_3.getError)(error),
|
|
180
|
+
deviceSN: this.getSerial(),
|
|
181
|
+
type: type,
|
|
182
|
+
value: value,
|
|
183
|
+
source: source,
|
|
184
|
+
});
|
|
150
185
|
}
|
|
151
186
|
else {
|
|
152
|
-
logging_1.rootHTTPLogger.error("Device update raw property - Property error", {
|
|
187
|
+
logging_1.rootHTTPLogger.error("Device update raw property - Property error", {
|
|
188
|
+
error: (0, utils_3.getError)(error),
|
|
189
|
+
deviceSN: this.getSerial(),
|
|
190
|
+
type: type,
|
|
191
|
+
value: value,
|
|
192
|
+
source: source,
|
|
193
|
+
});
|
|
153
194
|
}
|
|
154
195
|
}
|
|
155
196
|
}
|
|
@@ -161,8 +202,13 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
161
202
|
convertRawPropertyValue(property, value) {
|
|
162
203
|
try {
|
|
163
204
|
const val = value;
|
|
164
|
-
if (property.key === types_1.ParamType.PRIVATE_MODE ||
|
|
165
|
-
|
|
205
|
+
if (property.key === types_1.ParamType.PRIVATE_MODE ||
|
|
206
|
+
property.key === types_1.ParamType.OPEN_DEVICE ||
|
|
207
|
+
property.key === types_2.CommandType.CMD_DEVS_SWITCH) {
|
|
208
|
+
if ((this.isIndoorCamera() && !this.isIndoorPanAndTiltCameraS350()) ||
|
|
209
|
+
(this.isWiredDoorbell() && !this.isWiredDoorbellT8200X()) ||
|
|
210
|
+
this.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8422 ||
|
|
211
|
+
this.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8424) {
|
|
166
212
|
return value !== undefined ? (value === "true" ? true : false) : false;
|
|
167
213
|
}
|
|
168
214
|
return value !== undefined ? (value === "0" ? true : false) : false;
|
|
@@ -173,7 +219,9 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
173
219
|
case types_1.PropertyName.DeviceNotificationRing: {
|
|
174
220
|
const booleanProperty = property;
|
|
175
221
|
try {
|
|
176
|
-
return
|
|
222
|
+
return val && val.notification_ring_onoff !== undefined
|
|
223
|
+
? Number.parseInt(val.notification_ring_onoff) === 1
|
|
224
|
+
: (booleanProperty.default ?? false);
|
|
177
225
|
}
|
|
178
226
|
catch (err) {
|
|
179
227
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -184,7 +232,9 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
184
232
|
case types_1.PropertyName.DeviceNotificationMotion: {
|
|
185
233
|
const booleanProperty = property;
|
|
186
234
|
try {
|
|
187
|
-
return
|
|
235
|
+
return val && val.notification_motion_onoff !== undefined
|
|
236
|
+
? Number.parseInt(val.notification_motion_onoff) === 1
|
|
237
|
+
: (booleanProperty.default ?? false);
|
|
188
238
|
}
|
|
189
239
|
catch (err) {
|
|
190
240
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -195,12 +245,14 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
195
245
|
case types_1.PropertyName.DeviceNotificationType: {
|
|
196
246
|
const numericProperty = property;
|
|
197
247
|
try {
|
|
198
|
-
return
|
|
248
|
+
return val && val.notification_style !== undefined
|
|
249
|
+
? Number.parseInt(val.notification_style)
|
|
250
|
+
: (numericProperty.default ?? numericProperty.min ?? 0);
|
|
199
251
|
}
|
|
200
252
|
catch (err) {
|
|
201
253
|
const error = (0, error_2.ensureError)(err);
|
|
202
254
|
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_BAT_DOORBELL_SET_NOTIFICATION_MODE DeviceNotificationType Error", { error: (0, utils_3.getError)(error), deviceSN: this.getSerial(), property: property, value: value });
|
|
203
|
-
return numericProperty.default ??
|
|
255
|
+
return numericProperty.default ?? numericProperty.min ?? 0;
|
|
204
256
|
}
|
|
205
257
|
}
|
|
206
258
|
}
|
|
@@ -209,14 +261,27 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
209
261
|
try {
|
|
210
262
|
switch (property.name) {
|
|
211
263
|
case types_1.PropertyName.DeviceNotificationRing:
|
|
212
|
-
return value !== undefined
|
|
264
|
+
return value !== undefined
|
|
265
|
+
? Number.parseInt(val) === 3 || Number.parseInt(val) === 1
|
|
266
|
+
? true
|
|
267
|
+
: false
|
|
268
|
+
: false;
|
|
213
269
|
case types_1.PropertyName.DeviceNotificationMotion:
|
|
214
|
-
return value !== undefined
|
|
270
|
+
return value !== undefined
|
|
271
|
+
? Number.parseInt(val) === 3 || Number.parseInt(val) === 2
|
|
272
|
+
? true
|
|
273
|
+
: false
|
|
274
|
+
: false;
|
|
215
275
|
}
|
|
216
276
|
}
|
|
217
277
|
catch (err) {
|
|
218
278
|
const error = (0, error_2.ensureError)(err);
|
|
219
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - DOORBELL_NOTIFICATION_OPEN Error", {
|
|
279
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - DOORBELL_NOTIFICATION_OPEN Error", {
|
|
280
|
+
error: (0, utils_3.getError)(error),
|
|
281
|
+
deviceSN: this.getSerial(),
|
|
282
|
+
property: property,
|
|
283
|
+
value: value,
|
|
284
|
+
});
|
|
220
285
|
return false;
|
|
221
286
|
}
|
|
222
287
|
}
|
|
@@ -224,7 +289,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
224
289
|
const numericProperty = property;
|
|
225
290
|
try {
|
|
226
291
|
if (this.getDeviceType() === types_1.DeviceType.CAMERA || this.getDeviceType() === types_1.DeviceType.CAMERA_E) {
|
|
227
|
-
const convertedValue = (
|
|
292
|
+
const convertedValue = (200 - Number.parseInt(value)) / 2 + 1;
|
|
228
293
|
return convertedValue;
|
|
229
294
|
}
|
|
230
295
|
else if (this.isCamera2Product()) {
|
|
@@ -258,16 +323,32 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
258
323
|
return convertedValue;
|
|
259
324
|
}
|
|
260
325
|
else {
|
|
261
|
-
return value !== undefined
|
|
326
|
+
return value !== undefined
|
|
327
|
+
? Number.parseInt(value)
|
|
328
|
+
: numericProperty.default !== undefined
|
|
329
|
+
? numericProperty.default
|
|
330
|
+
: numericProperty.min !== undefined
|
|
331
|
+
? numericProperty.min
|
|
332
|
+
: 0;
|
|
262
333
|
}
|
|
263
334
|
}
|
|
264
335
|
catch (err) {
|
|
265
336
|
const error = (0, error_2.ensureError)(err);
|
|
266
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_PIRSENSITIVITY Error", {
|
|
267
|
-
|
|
337
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_PIRSENSITIVITY Error", {
|
|
338
|
+
error: (0, utils_3.getError)(error),
|
|
339
|
+
deviceSN: this.getSerial(),
|
|
340
|
+
property: property,
|
|
341
|
+
value: value,
|
|
342
|
+
});
|
|
343
|
+
return numericProperty.default !== undefined
|
|
344
|
+
? numericProperty.default
|
|
345
|
+
: numericProperty.min !== undefined
|
|
346
|
+
? numericProperty.min
|
|
347
|
+
: 0;
|
|
268
348
|
}
|
|
269
349
|
}
|
|
270
|
-
else if (property.key === types_2.CommandType.CMD_SMARTLOCK_AUTO_LOCK_SCHEDULE_STARTTIME ||
|
|
350
|
+
else if (property.key === types_2.CommandType.CMD_SMARTLOCK_AUTO_LOCK_SCHEDULE_STARTTIME ||
|
|
351
|
+
property.key === types_2.CommandType.CMD_SMARTLOCK_AUTO_LOCK_SCHEDULE_ENDTIME) {
|
|
271
352
|
const tmpBuffer = Buffer.from(value, "hex");
|
|
272
353
|
return `${tmpBuffer.subarray(0, 1).readInt8().toString().padStart(2, "0")}:${tmpBuffer.subarray(1).readInt8().toString().padStart(2, "0")}`;
|
|
273
354
|
}
|
|
@@ -276,31 +357,95 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
276
357
|
try {
|
|
277
358
|
switch (property.name) {
|
|
278
359
|
case types_1.PropertyName.DeviceMotionDetectionSensitivityMode:
|
|
279
|
-
return value !== undefined && val.model !== undefined
|
|
360
|
+
return value !== undefined && val.model !== undefined
|
|
361
|
+
? val.model
|
|
362
|
+
: numericProperty.default !== undefined
|
|
363
|
+
? numericProperty.default
|
|
364
|
+
: numericProperty.min !== undefined
|
|
365
|
+
? numericProperty.min
|
|
366
|
+
: 0;
|
|
280
367
|
case types_1.PropertyName.DeviceMotionDetectionSensitivityStandard:
|
|
281
|
-
return value !== undefined && val.model === 0
|
|
368
|
+
return value !== undefined && val.model === 0
|
|
369
|
+
? (0, utils_1.getDistances)(val.block_list)[0]
|
|
370
|
+
: numericProperty.default !== undefined
|
|
371
|
+
? numericProperty.default
|
|
372
|
+
: numericProperty.min !== undefined
|
|
373
|
+
? numericProperty.min
|
|
374
|
+
: 0;
|
|
282
375
|
case types_1.PropertyName.DeviceMotionDetectionSensitivityAdvancedA:
|
|
283
|
-
return value !== undefined && val.model === 1
|
|
376
|
+
return value !== undefined && val.model === 1
|
|
377
|
+
? (0, utils_1.getDistances)(val.block_list)[0]
|
|
378
|
+
: numericProperty.default !== undefined
|
|
379
|
+
? numericProperty.default
|
|
380
|
+
: numericProperty.min !== undefined
|
|
381
|
+
? numericProperty.min
|
|
382
|
+
: 0;
|
|
284
383
|
case types_1.PropertyName.DeviceMotionDetectionSensitivityAdvancedB:
|
|
285
|
-
return value !== undefined && val.model === 1
|
|
384
|
+
return value !== undefined && val.model === 1
|
|
385
|
+
? (0, utils_1.getDistances)(val.block_list)[1]
|
|
386
|
+
: numericProperty.default !== undefined
|
|
387
|
+
? numericProperty.default
|
|
388
|
+
: numericProperty.min !== undefined
|
|
389
|
+
? numericProperty.min
|
|
390
|
+
: 0;
|
|
286
391
|
case types_1.PropertyName.DeviceMotionDetectionSensitivityAdvancedC:
|
|
287
|
-
return value !== undefined && val.model === 1
|
|
392
|
+
return value !== undefined && val.model === 1
|
|
393
|
+
? (0, utils_1.getDistances)(val.block_list)[2]
|
|
394
|
+
: numericProperty.default !== undefined
|
|
395
|
+
? numericProperty.default
|
|
396
|
+
: numericProperty.min !== undefined
|
|
397
|
+
? numericProperty.min
|
|
398
|
+
: 0;
|
|
288
399
|
case types_1.PropertyName.DeviceMotionDetectionSensitivityAdvancedD:
|
|
289
|
-
return value !== undefined && val.model === 1
|
|
400
|
+
return value !== undefined && val.model === 1
|
|
401
|
+
? (0, utils_1.getDistances)(val.block_list)[3]
|
|
402
|
+
: numericProperty.default !== undefined
|
|
403
|
+
? numericProperty.default
|
|
404
|
+
: numericProperty.min !== undefined
|
|
405
|
+
? numericProperty.min
|
|
406
|
+
: 0;
|
|
290
407
|
case types_1.PropertyName.DeviceMotionDetectionSensitivityAdvancedE:
|
|
291
|
-
return value !== undefined && val.model === 1
|
|
408
|
+
return value !== undefined && val.model === 1
|
|
409
|
+
? (0, utils_1.getDistances)(val.block_list)[4]
|
|
410
|
+
: numericProperty.default !== undefined
|
|
411
|
+
? numericProperty.default
|
|
412
|
+
: numericProperty.min !== undefined
|
|
413
|
+
? numericProperty.min
|
|
414
|
+
: 0;
|
|
292
415
|
case types_1.PropertyName.DeviceMotionDetectionSensitivityAdvancedF:
|
|
293
|
-
return value !== undefined && val.model === 1
|
|
416
|
+
return value !== undefined && val.model === 1
|
|
417
|
+
? (0, utils_1.getDistances)(val.block_list)[5]
|
|
418
|
+
: numericProperty.default !== undefined
|
|
419
|
+
? numericProperty.default
|
|
420
|
+
: numericProperty.min !== undefined
|
|
421
|
+
? numericProperty.min
|
|
422
|
+
: 0;
|
|
294
423
|
case types_1.PropertyName.DeviceMotionDetectionSensitivityAdvancedG:
|
|
295
|
-
return value !== undefined && val.model === 1
|
|
424
|
+
return value !== undefined && val.model === 1
|
|
425
|
+
? (0, utils_1.getDistances)(val.block_list)[6]
|
|
426
|
+
: numericProperty.default !== undefined
|
|
427
|
+
? numericProperty.default
|
|
428
|
+
: numericProperty.min !== undefined
|
|
429
|
+
? numericProperty.min
|
|
430
|
+
: 0;
|
|
296
431
|
case types_1.PropertyName.DeviceMotionDetectionSensitivityAdvancedH:
|
|
297
|
-
return value !== undefined && val.model === 1
|
|
432
|
+
return value !== undefined && val.model === 1
|
|
433
|
+
? (0, utils_1.getDistances)(val.block_list)[7]
|
|
434
|
+
: numericProperty.default !== undefined
|
|
435
|
+
? numericProperty.default
|
|
436
|
+
: numericProperty.min !== undefined
|
|
437
|
+
? numericProperty.min
|
|
438
|
+
: 0;
|
|
298
439
|
}
|
|
299
440
|
}
|
|
300
441
|
catch (err) {
|
|
301
442
|
const error = (0, error_2.ensureError)(err);
|
|
302
443
|
logging_1.rootHTTPLogger.error(`Device convert raw property - CMD_DOORBELL_DUAL_RADAR_WD_DETECTION_SENSITIVITY ${property.name} Error`, { error: (0, utils_3.getError)(error), deviceSN: this.getSerial(), property: property, value: value });
|
|
303
|
-
return numericProperty.default !== undefined
|
|
444
|
+
return numericProperty.default !== undefined
|
|
445
|
+
? numericProperty.default
|
|
446
|
+
: numericProperty.min !== undefined
|
|
447
|
+
? numericProperty.min
|
|
448
|
+
: 0;
|
|
304
449
|
}
|
|
305
450
|
}
|
|
306
451
|
else if (property.key === types_2.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_AUTO_RESPONSE) {
|
|
@@ -308,7 +453,14 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
308
453
|
case types_1.PropertyName.DeviceLoiteringCustomResponseTimeFrom: {
|
|
309
454
|
const stringProperty = property;
|
|
310
455
|
try {
|
|
311
|
-
return
|
|
456
|
+
return val?.setting?.length !== undefined &&
|
|
457
|
+
val?.setting?.length > 0 &&
|
|
458
|
+
val?.setting[0]?.start_hour !== undefined &&
|
|
459
|
+
val?.setting[0]?.start_min !== undefined
|
|
460
|
+
? `${val?.setting[0]?.start_hour?.padStart(2, "0")}:${val?.setting[0]?.start_min?.padStart(2, "0")}`
|
|
461
|
+
: stringProperty.default !== undefined
|
|
462
|
+
? stringProperty.default
|
|
463
|
+
: "";
|
|
312
464
|
}
|
|
313
465
|
catch (err) {
|
|
314
466
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -319,7 +471,14 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
319
471
|
case types_1.PropertyName.DeviceLoiteringCustomResponseTimeTo: {
|
|
320
472
|
const stringProperty = property;
|
|
321
473
|
try {
|
|
322
|
-
return
|
|
474
|
+
return val?.setting?.length !== undefined &&
|
|
475
|
+
val?.setting?.length > 0 &&
|
|
476
|
+
val?.setting[0]?.end_hour !== undefined &&
|
|
477
|
+
val?.setting[0]?.end_min !== undefined
|
|
478
|
+
? `${val?.setting[0]?.end_hour?.padStart(2, "0")}:${val?.setting[0]?.end_min?.padStart(2, "0")}`
|
|
479
|
+
: stringProperty.default !== undefined
|
|
480
|
+
? stringProperty.default
|
|
481
|
+
: "";
|
|
323
482
|
}
|
|
324
483
|
catch (err) {
|
|
325
484
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -330,7 +489,11 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
330
489
|
case types_1.PropertyName.DeviceLoiteringCustomResponsePhoneNotification: {
|
|
331
490
|
const booleanProperty = property;
|
|
332
491
|
try {
|
|
333
|
-
return val?.setting[0]?.push_notify === 1
|
|
492
|
+
return val?.setting[0]?.push_notify === 1
|
|
493
|
+
? true
|
|
494
|
+
: booleanProperty.default !== undefined
|
|
495
|
+
? booleanProperty.default
|
|
496
|
+
: false;
|
|
334
497
|
}
|
|
335
498
|
catch (err) {
|
|
336
499
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -341,7 +504,11 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
341
504
|
case types_1.PropertyName.DeviceLoiteringCustomResponseHomeBaseNotification: {
|
|
342
505
|
const booleanProperty = property;
|
|
343
506
|
try {
|
|
344
|
-
return val?.setting[0]?.homebase_alert === 1
|
|
507
|
+
return val?.setting[0]?.homebase_alert === 1
|
|
508
|
+
? true
|
|
509
|
+
: booleanProperty.default !== undefined
|
|
510
|
+
? booleanProperty.default
|
|
511
|
+
: false;
|
|
345
512
|
}
|
|
346
513
|
catch (err) {
|
|
347
514
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -352,7 +519,11 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
352
519
|
case types_1.PropertyName.DeviceLoiteringCustomResponseAutoVoiceResponse: {
|
|
353
520
|
const booleanProperty = property;
|
|
354
521
|
try {
|
|
355
|
-
return val?.setting[0]?.auto_voice_resp === 1
|
|
522
|
+
return val?.setting[0]?.auto_voice_resp === 1
|
|
523
|
+
? true
|
|
524
|
+
: booleanProperty.default !== undefined
|
|
525
|
+
? booleanProperty.default
|
|
526
|
+
: false;
|
|
356
527
|
}
|
|
357
528
|
catch (err) {
|
|
358
529
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -363,12 +534,24 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
363
534
|
case types_1.PropertyName.DeviceLoiteringCustomResponseAutoVoiceResponseVoice: {
|
|
364
535
|
const numericProperty = property;
|
|
365
536
|
try {
|
|
366
|
-
return
|
|
537
|
+
return val?.setting?.length !== undefined &&
|
|
538
|
+
val?.setting?.length > 0 &&
|
|
539
|
+
val?.setting[0]?.auto_voice_id !== undefined
|
|
540
|
+
? val?.setting[0]?.auto_voice_id
|
|
541
|
+
: numericProperty.default !== undefined
|
|
542
|
+
? numericProperty.default
|
|
543
|
+
: numericProperty.min !== undefined
|
|
544
|
+
? numericProperty.min
|
|
545
|
+
: 0;
|
|
367
546
|
}
|
|
368
547
|
catch (err) {
|
|
369
548
|
const error = (0, error_2.ensureError)(err);
|
|
370
549
|
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_RADAR_WD_AUTO_RESPONSE DeviceLoiteringCustomResponseAutoVoiceResponseVoice Error", { error: (0, utils_3.getError)(error), deviceSN: this.getSerial(), property: property, value: value });
|
|
371
|
-
return numericProperty.default !== undefined
|
|
550
|
+
return numericProperty.default !== undefined
|
|
551
|
+
? numericProperty.default
|
|
552
|
+
: numericProperty.min !== undefined
|
|
553
|
+
? numericProperty.min
|
|
554
|
+
: 0;
|
|
372
555
|
}
|
|
373
556
|
}
|
|
374
557
|
}
|
|
@@ -376,22 +559,40 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
376
559
|
else if (property.key === types_2.CommandType.CMD_DOORBELL_DUAL_DELIVERY_GUARD_SWITCH) {
|
|
377
560
|
const booleanProperty = property;
|
|
378
561
|
try {
|
|
379
|
-
return value !== undefined && val.ai_bottom_switch !== undefined
|
|
562
|
+
return value !== undefined && val.ai_bottom_switch !== undefined
|
|
563
|
+
? val.ai_bottom_switch === 1024
|
|
564
|
+
: booleanProperty.default !== undefined
|
|
565
|
+
? booleanProperty.default
|
|
566
|
+
: false;
|
|
380
567
|
}
|
|
381
568
|
catch (err) {
|
|
382
569
|
const error = (0, error_2.ensureError)(err);
|
|
383
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_DELIVERY_GUARD_SWITCH Error", {
|
|
570
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_DELIVERY_GUARD_SWITCH Error", {
|
|
571
|
+
error: (0, utils_3.getError)(error),
|
|
572
|
+
deviceSN: this.getSerial(),
|
|
573
|
+
property: property,
|
|
574
|
+
value: value,
|
|
575
|
+
});
|
|
384
576
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
385
577
|
}
|
|
386
578
|
}
|
|
387
579
|
else if (property.key === types_2.CommandType.CMD_DOORBELL_DUAL_PACKAGE_STRAND_TIME) {
|
|
388
580
|
const stringProperty = property;
|
|
389
581
|
try {
|
|
390
|
-
return
|
|
582
|
+
return val?.start_h !== undefined && val?.start_m !== undefined
|
|
583
|
+
? `${val?.start_h?.toString().padStart(2, "0")}:${val?.start_m?.toString().padStart(2, "0")}`
|
|
584
|
+
: stringProperty.default !== undefined
|
|
585
|
+
? stringProperty.default
|
|
586
|
+
: "";
|
|
391
587
|
}
|
|
392
588
|
catch (err) {
|
|
393
589
|
const error = (0, error_2.ensureError)(err);
|
|
394
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_PACKAGE_STRAND_TIME Error", {
|
|
590
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_PACKAGE_STRAND_TIME Error", {
|
|
591
|
+
error: (0, utils_3.getError)(error),
|
|
592
|
+
deviceSN: this.getSerial(),
|
|
593
|
+
property: property,
|
|
594
|
+
value: value,
|
|
595
|
+
});
|
|
395
596
|
return stringProperty.default !== undefined ? stringProperty.default : "";
|
|
396
597
|
}
|
|
397
598
|
}
|
|
@@ -400,7 +601,11 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
400
601
|
case types_1.PropertyName.DeviceRingAutoResponse: {
|
|
401
602
|
const booleanProperty = property;
|
|
402
603
|
try {
|
|
403
|
-
return value?.setting[0]?.active === 1
|
|
604
|
+
return value?.setting[0]?.active === 1
|
|
605
|
+
? true
|
|
606
|
+
: booleanProperty.default !== undefined
|
|
607
|
+
? booleanProperty.default
|
|
608
|
+
: false;
|
|
404
609
|
}
|
|
405
610
|
catch (err) {
|
|
406
611
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -411,7 +616,11 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
411
616
|
case types_1.PropertyName.DeviceRingAutoResponseVoiceResponse: {
|
|
412
617
|
const booleanProperty = property;
|
|
413
618
|
try {
|
|
414
|
-
return value?.setting[0]?.active === 1
|
|
619
|
+
return value?.setting[0]?.active === 1
|
|
620
|
+
? true
|
|
621
|
+
: booleanProperty.default !== undefined
|
|
622
|
+
? booleanProperty.default
|
|
623
|
+
: false;
|
|
415
624
|
}
|
|
416
625
|
catch (err) {
|
|
417
626
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -422,7 +631,14 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
422
631
|
case types_1.PropertyName.DeviceRingAutoResponseTimeFrom: {
|
|
423
632
|
const stringProperty = property;
|
|
424
633
|
try {
|
|
425
|
-
return
|
|
634
|
+
return value?.setting?.length !== undefined &&
|
|
635
|
+
value?.setting?.length > 0 &&
|
|
636
|
+
value?.setting[0]?.start_hour !== undefined &&
|
|
637
|
+
value?.setting[0]?.start_min !== undefined
|
|
638
|
+
? `${value?.setting[0]?.start_hour?.padStart(2, "0")}:${value?.setting[0]?.start_min?.padStart(2, "0")}`
|
|
639
|
+
: stringProperty.default !== undefined
|
|
640
|
+
? stringProperty.default
|
|
641
|
+
: "";
|
|
426
642
|
}
|
|
427
643
|
catch (err) {
|
|
428
644
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -433,7 +649,14 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
433
649
|
case types_1.PropertyName.DeviceRingAutoResponseTimeTo: {
|
|
434
650
|
const stringProperty = property;
|
|
435
651
|
try {
|
|
436
|
-
return
|
|
652
|
+
return value?.setting?.length !== undefined &&
|
|
653
|
+
value?.setting?.length > 0 &&
|
|
654
|
+
value?.setting[0]?.end_hour !== undefined &&
|
|
655
|
+
value?.setting[0]?.end_min !== undefined
|
|
656
|
+
? `${value?.setting[0]?.end_hour?.padStart(2, "0")}:${value?.setting[0]?.end_min?.padStart(2, "0")}`
|
|
657
|
+
: stringProperty.default !== undefined
|
|
658
|
+
? stringProperty.default
|
|
659
|
+
: "";
|
|
437
660
|
}
|
|
438
661
|
catch (err) {
|
|
439
662
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -444,12 +667,24 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
444
667
|
case types_1.PropertyName.DeviceRingAutoResponseVoiceResponseVoice: {
|
|
445
668
|
const numericProperty = property;
|
|
446
669
|
try {
|
|
447
|
-
return
|
|
670
|
+
return value?.setting?.length !== undefined &&
|
|
671
|
+
value?.setting?.length > 0 &&
|
|
672
|
+
value?.setting[0]?.auto_voice_id !== undefined
|
|
673
|
+
? value?.setting[0]?.auto_voice_id
|
|
674
|
+
: numericProperty.default !== undefined
|
|
675
|
+
? numericProperty.default
|
|
676
|
+
: numericProperty.min !== undefined
|
|
677
|
+
? numericProperty.min
|
|
678
|
+
: 0;
|
|
448
679
|
}
|
|
449
680
|
catch (err) {
|
|
450
681
|
const error = (0, error_2.ensureError)(err);
|
|
451
682
|
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_RING_AUTO_RESPONSE DeviceRingAutoResponseVoiceResponseVoice Error", { error: (0, utils_3.getError)(error), deviceSN: this.getSerial(), property: property, value: value });
|
|
452
|
-
return numericProperty.default !== undefined
|
|
683
|
+
return numericProperty.default !== undefined
|
|
684
|
+
? numericProperty.default
|
|
685
|
+
: numericProperty.min !== undefined
|
|
686
|
+
? numericProperty.min
|
|
687
|
+
: 0;
|
|
453
688
|
}
|
|
454
689
|
}
|
|
455
690
|
}
|
|
@@ -459,7 +694,11 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
459
694
|
case types_1.PropertyName.DeviceDeliveryGuardPackageGuardingActivatedTimeFrom: {
|
|
460
695
|
const stringProperty = property;
|
|
461
696
|
try {
|
|
462
|
-
return
|
|
697
|
+
return value?.start_h !== undefined && value?.start_m !== undefined
|
|
698
|
+
? `${value?.start_h?.toString().padStart(2, "0")}:${value?.start_m?.toString().padStart(2, "0")}`
|
|
699
|
+
: stringProperty.default !== undefined
|
|
700
|
+
? stringProperty.default
|
|
701
|
+
: "";
|
|
463
702
|
}
|
|
464
703
|
catch (err) {
|
|
465
704
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -470,7 +709,11 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
470
709
|
case types_1.PropertyName.DeviceDeliveryGuardPackageGuardingActivatedTimeTo: {
|
|
471
710
|
const stringProperty = property;
|
|
472
711
|
try {
|
|
473
|
-
return
|
|
712
|
+
return value?.end_h !== undefined && value?.end_m !== undefined
|
|
713
|
+
? `${value?.end_h?.toString().padStart(2, "0")}:${value?.end_m?.toString().padStart(2, "0")}`
|
|
714
|
+
: stringProperty.default !== undefined
|
|
715
|
+
? stringProperty.default
|
|
716
|
+
: "";
|
|
474
717
|
}
|
|
475
718
|
catch (err) {
|
|
476
719
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -483,34 +726,79 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
483
726
|
else if (property.key === types_2.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_DISTANCE) {
|
|
484
727
|
const numericProperty = property;
|
|
485
728
|
try {
|
|
486
|
-
return value !== undefined && value.radar_wd_distance !== undefined
|
|
729
|
+
return value !== undefined && value.radar_wd_distance !== undefined
|
|
730
|
+
? value.radar_wd_distance
|
|
731
|
+
: numericProperty.default !== undefined
|
|
732
|
+
? numericProperty.default
|
|
733
|
+
: numericProperty.min !== undefined
|
|
734
|
+
? numericProperty.min
|
|
735
|
+
: 0;
|
|
487
736
|
}
|
|
488
737
|
catch (err) {
|
|
489
738
|
const error = (0, error_2.ensureError)(err);
|
|
490
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_RADAR_WD_DISTANCE Error", {
|
|
491
|
-
|
|
739
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_RADAR_WD_DISTANCE Error", {
|
|
740
|
+
error: (0, utils_3.getError)(error),
|
|
741
|
+
deviceSN: this.getSerial(),
|
|
742
|
+
property: property,
|
|
743
|
+
value: value,
|
|
744
|
+
});
|
|
745
|
+
return numericProperty.default !== undefined
|
|
746
|
+
? numericProperty.default
|
|
747
|
+
: numericProperty.min !== undefined
|
|
748
|
+
? numericProperty.min
|
|
749
|
+
: 0;
|
|
492
750
|
}
|
|
493
751
|
}
|
|
494
752
|
else if (property.key === types_2.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_TIME) {
|
|
495
753
|
const numericProperty = property;
|
|
496
754
|
try {
|
|
497
|
-
return value !== undefined && value.radar_wd_time !== undefined
|
|
755
|
+
return value !== undefined && value.radar_wd_time !== undefined
|
|
756
|
+
? value.radar_wd_time
|
|
757
|
+
: numericProperty.default !== undefined
|
|
758
|
+
? numericProperty.default
|
|
759
|
+
: numericProperty.min !== undefined
|
|
760
|
+
? numericProperty.min
|
|
761
|
+
: 0;
|
|
498
762
|
}
|
|
499
763
|
catch (err) {
|
|
500
764
|
const error = (0, error_2.ensureError)(err);
|
|
501
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_RADAR_WD_TIME Error", {
|
|
502
|
-
|
|
765
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_RADAR_WD_TIME Error", {
|
|
766
|
+
error: (0, utils_3.getError)(error),
|
|
767
|
+
deviceSN: this.getSerial(),
|
|
768
|
+
property: property,
|
|
769
|
+
value: value,
|
|
770
|
+
});
|
|
771
|
+
return numericProperty.default !== undefined
|
|
772
|
+
? numericProperty.default
|
|
773
|
+
: numericProperty.min !== undefined
|
|
774
|
+
? numericProperty.min
|
|
775
|
+
: 0;
|
|
503
776
|
}
|
|
504
777
|
}
|
|
505
778
|
else if (property.key === types_2.CommandType.CMD_DOORBELL_DUAL_PACKAGE_GUARD_VOICE) {
|
|
506
779
|
const numericProperty = property;
|
|
507
780
|
try {
|
|
508
|
-
return value !== undefined && value.auto_voice_id !== undefined
|
|
781
|
+
return value !== undefined && value.auto_voice_id !== undefined
|
|
782
|
+
? value.auto_voice_id
|
|
783
|
+
: numericProperty.default !== undefined
|
|
784
|
+
? numericProperty.default
|
|
785
|
+
: numericProperty.min !== undefined
|
|
786
|
+
? numericProperty.min
|
|
787
|
+
: 0;
|
|
509
788
|
}
|
|
510
789
|
catch (err) {
|
|
511
790
|
const error = (0, error_2.ensureError)(err);
|
|
512
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_PACKAGE_GUARD_VOICE Error", {
|
|
513
|
-
|
|
791
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_DOORBELL_DUAL_PACKAGE_GUARD_VOICE Error", {
|
|
792
|
+
error: (0, utils_3.getError)(error),
|
|
793
|
+
deviceSN: this.getSerial(),
|
|
794
|
+
property: property,
|
|
795
|
+
value: value,
|
|
796
|
+
});
|
|
797
|
+
return numericProperty.default !== undefined
|
|
798
|
+
? numericProperty.default
|
|
799
|
+
: numericProperty.min !== undefined
|
|
800
|
+
? numericProperty.min
|
|
801
|
+
: 0;
|
|
514
802
|
}
|
|
515
803
|
}
|
|
516
804
|
else if (property.key === types_2.CommandType.CMD_MOTION_SET_LEAVING_REACTIONS) {
|
|
@@ -518,7 +806,13 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
518
806
|
case types_1.PropertyName.DeviceLeavingReactionStartTime: {
|
|
519
807
|
const stringProperty = property;
|
|
520
808
|
try {
|
|
521
|
-
return
|
|
809
|
+
return value !== undefined &&
|
|
810
|
+
value.start_hour !== undefined &&
|
|
811
|
+
value.start_min !== undefined
|
|
812
|
+
? `${value.start_hour.padStart(2, "0")}:${value.start_min.padStart(2, "0")}`
|
|
813
|
+
: stringProperty.default !== undefined
|
|
814
|
+
? stringProperty.default
|
|
815
|
+
: "";
|
|
522
816
|
}
|
|
523
817
|
catch (err) {
|
|
524
818
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -529,7 +823,13 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
529
823
|
case types_1.PropertyName.DeviceLeavingReactionEndTime: {
|
|
530
824
|
const stringProperty = property;
|
|
531
825
|
try {
|
|
532
|
-
return
|
|
826
|
+
return value !== undefined &&
|
|
827
|
+
value.end_hour !== undefined &&
|
|
828
|
+
value.end_min !== undefined
|
|
829
|
+
? `${value.end_hour.padStart(2, "0")}:${value.end_min.padStart(2, "0")}`
|
|
830
|
+
: stringProperty.default !== undefined
|
|
831
|
+
? stringProperty.default
|
|
832
|
+
: "";
|
|
533
833
|
}
|
|
534
834
|
catch (err) {
|
|
535
835
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -540,7 +840,11 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
540
840
|
case types_1.PropertyName.DeviceLeavingReactionNotification: {
|
|
541
841
|
const booleanProperty = property;
|
|
542
842
|
try {
|
|
543
|
-
return value !== undefined && value.push_notify === 1
|
|
843
|
+
return value !== undefined && value.push_notify === 1
|
|
844
|
+
? true
|
|
845
|
+
: booleanProperty.default !== undefined
|
|
846
|
+
? booleanProperty.default
|
|
847
|
+
: false;
|
|
544
848
|
}
|
|
545
849
|
catch (err) {
|
|
546
850
|
const error = (0, error_2.ensureError)(err);
|
|
@@ -555,66 +859,143 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
555
859
|
case types_1.PropertyName.DeviceSnooze: {
|
|
556
860
|
const booleanProperty = property;
|
|
557
861
|
try {
|
|
558
|
-
return value !== undefined &&
|
|
862
|
+
return value !== undefined &&
|
|
863
|
+
value.snooze_time !== undefined &&
|
|
864
|
+
value.snooze_time !== "" &&
|
|
865
|
+
Number.parseInt(value.snooze_time) !== 0
|
|
866
|
+
? true
|
|
867
|
+
: booleanProperty.default !== undefined
|
|
868
|
+
? booleanProperty.default
|
|
869
|
+
: false;
|
|
559
870
|
}
|
|
560
871
|
catch (err) {
|
|
561
872
|
const error = (0, error_2.ensureError)(err);
|
|
562
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnooze Error", {
|
|
873
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnooze Error", {
|
|
874
|
+
error: (0, utils_3.getError)(error),
|
|
875
|
+
deviceSN: this.getSerial(),
|
|
876
|
+
property: property,
|
|
877
|
+
value: value,
|
|
878
|
+
});
|
|
563
879
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
564
880
|
}
|
|
565
881
|
}
|
|
566
882
|
case types_1.PropertyName.DeviceSnoozeTime: {
|
|
567
883
|
const numericProperty = property;
|
|
568
884
|
try {
|
|
569
|
-
return value !== undefined &&
|
|
885
|
+
return value !== undefined &&
|
|
886
|
+
value.snooze_time !== undefined &&
|
|
887
|
+
value.snooze_time !== ""
|
|
888
|
+
? Number.parseInt(value.snooze_time)
|
|
889
|
+
: numericProperty.default !== undefined
|
|
890
|
+
? numericProperty.default
|
|
891
|
+
: numericProperty.min !== undefined
|
|
892
|
+
? numericProperty.min
|
|
893
|
+
: 0;
|
|
570
894
|
}
|
|
571
895
|
catch (err) {
|
|
572
896
|
const error = (0, error_2.ensureError)(err);
|
|
573
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnoozeTime Error", {
|
|
574
|
-
|
|
897
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnoozeTime Error", {
|
|
898
|
+
error: (0, utils_3.getError)(error),
|
|
899
|
+
deviceSN: this.getSerial(),
|
|
900
|
+
property: property,
|
|
901
|
+
value: value,
|
|
902
|
+
});
|
|
903
|
+
return numericProperty.default !== undefined
|
|
904
|
+
? numericProperty.default
|
|
905
|
+
: numericProperty.min !== undefined
|
|
906
|
+
? numericProperty.min
|
|
907
|
+
: 0;
|
|
575
908
|
}
|
|
576
909
|
}
|
|
577
910
|
case types_1.PropertyName.DeviceSnoozeStartTime: {
|
|
578
911
|
const numericProperty = property;
|
|
579
912
|
try {
|
|
580
|
-
return value !== undefined && value.startTime !== undefined
|
|
913
|
+
return value !== undefined && value.startTime !== undefined
|
|
914
|
+
? Number.parseInt(value.startTime)
|
|
915
|
+
: numericProperty.default !== undefined
|
|
916
|
+
? numericProperty.default
|
|
917
|
+
: numericProperty.min !== undefined
|
|
918
|
+
? numericProperty.min
|
|
919
|
+
: 0;
|
|
581
920
|
}
|
|
582
921
|
catch (err) {
|
|
583
922
|
const error = (0, error_2.ensureError)(err);
|
|
584
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnoozeTime Error", {
|
|
585
|
-
|
|
923
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnoozeTime Error", {
|
|
924
|
+
error: (0, utils_3.getError)(error),
|
|
925
|
+
deviceSN: this.getSerial(),
|
|
926
|
+
property: property,
|
|
927
|
+
value: value,
|
|
928
|
+
});
|
|
929
|
+
return numericProperty.default !== undefined
|
|
930
|
+
? numericProperty.default
|
|
931
|
+
: numericProperty.min !== undefined
|
|
932
|
+
? numericProperty.min
|
|
933
|
+
: 0;
|
|
586
934
|
}
|
|
587
935
|
}
|
|
588
936
|
case types_1.PropertyName.DeviceSnoozeHomebase: {
|
|
589
937
|
const booleanProperty = property;
|
|
590
938
|
try {
|
|
591
|
-
return value !== undefined && value.homebase_onoff !== undefined
|
|
939
|
+
return value !== undefined && value.homebase_onoff !== undefined
|
|
940
|
+
? value.homebase_onoff === 1
|
|
941
|
+
? true
|
|
942
|
+
: false
|
|
943
|
+
: booleanProperty.default !== undefined
|
|
944
|
+
? booleanProperty.default
|
|
945
|
+
: false;
|
|
592
946
|
}
|
|
593
947
|
catch (err) {
|
|
594
948
|
const error = (0, error_2.ensureError)(err);
|
|
595
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnoozeHomebase Error", {
|
|
949
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnoozeHomebase Error", {
|
|
950
|
+
error: (0, utils_3.getError)(error),
|
|
951
|
+
deviceSN: this.getSerial(),
|
|
952
|
+
property: property,
|
|
953
|
+
value: value,
|
|
954
|
+
});
|
|
596
955
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
597
956
|
}
|
|
598
957
|
}
|
|
599
958
|
case types_1.PropertyName.DeviceSnoozeMotion: {
|
|
600
959
|
const booleanProperty = property;
|
|
601
960
|
try {
|
|
602
|
-
return value !== undefined && value.motion_notify_onoff !== undefined
|
|
961
|
+
return value !== undefined && value.motion_notify_onoff !== undefined
|
|
962
|
+
? value.motion_notify_onoff === 1
|
|
963
|
+
? true
|
|
964
|
+
: false
|
|
965
|
+
: booleanProperty.default !== undefined
|
|
966
|
+
? booleanProperty.default
|
|
967
|
+
: false;
|
|
603
968
|
}
|
|
604
969
|
catch (err) {
|
|
605
970
|
const error = (0, error_2.ensureError)(err);
|
|
606
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnoozeMotion Error", {
|
|
971
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnoozeMotion Error", {
|
|
972
|
+
error: (0, utils_3.getError)(error),
|
|
973
|
+
deviceSN: this.getSerial(),
|
|
974
|
+
property: property,
|
|
975
|
+
value: value,
|
|
976
|
+
});
|
|
607
977
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
608
978
|
}
|
|
609
979
|
}
|
|
610
980
|
case types_1.PropertyName.DeviceSnoozeChime: {
|
|
611
981
|
const booleanProperty = property;
|
|
612
982
|
try {
|
|
613
|
-
return value !== undefined && value.chime_onoff !== undefined
|
|
983
|
+
return value !== undefined && value.chime_onoff !== undefined
|
|
984
|
+
? value.chime_onoff === 1
|
|
985
|
+
? true
|
|
986
|
+
: false
|
|
987
|
+
: booleanProperty.default !== undefined
|
|
988
|
+
? booleanProperty.default
|
|
989
|
+
: false;
|
|
614
990
|
}
|
|
615
991
|
catch (err) {
|
|
616
992
|
const error = (0, error_2.ensureError)(err);
|
|
617
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnoozeChime Error", {
|
|
993
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_SET_SNOOZE_MODE DeviceSnoozeChime Error", {
|
|
994
|
+
error: (0, utils_3.getError)(error),
|
|
995
|
+
deviceSN: this.getSerial(),
|
|
996
|
+
property: property,
|
|
997
|
+
value: value,
|
|
998
|
+
});
|
|
618
999
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
619
1000
|
}
|
|
620
1001
|
}
|
|
@@ -624,52 +1005,120 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
624
1005
|
property.name === types_1.PropertyName.DeviceMotionDetectionTypeHumanRecognition ||
|
|
625
1006
|
property.name === types_1.PropertyName.DeviceMotionDetectionTypePet ||
|
|
626
1007
|
property.name === types_1.PropertyName.DeviceMotionDetectionTypeVehicle ||
|
|
627
|
-
property.name === types_1.PropertyName.DeviceMotionDetectionTypeAllOtherMotions) &&
|
|
1008
|
+
property.name === types_1.PropertyName.DeviceMotionDetectionTypeAllOtherMotions) &&
|
|
1009
|
+
this.getStationSerial().startsWith("T8030")) {
|
|
628
1010
|
const booleanProperty = property;
|
|
629
1011
|
try {
|
|
630
|
-
return (0, utils_1.isHB3DetectionModeEnabled)(Number.parseInt(value), property.name === types_1.PropertyName.DeviceMotionDetectionTypeHuman
|
|
1012
|
+
return (0, utils_1.isHB3DetectionModeEnabled)(Number.parseInt(value), property.name === types_1.PropertyName.DeviceMotionDetectionTypeHuman
|
|
1013
|
+
? types_1.HB3DetectionTypes.HUMAN_DETECTION
|
|
1014
|
+
: property.name === types_1.PropertyName.DeviceMotionDetectionTypeHumanRecognition
|
|
1015
|
+
? types_1.HB3DetectionTypes.HUMAN_RECOGNITION
|
|
1016
|
+
: property.name === types_1.PropertyName.DeviceMotionDetectionTypePet
|
|
1017
|
+
? types_1.HB3DetectionTypes.PET_DETECTION
|
|
1018
|
+
: property.name === types_1.PropertyName.DeviceMotionDetectionTypeVehicle
|
|
1019
|
+
? types_1.HB3DetectionTypes.VEHICLE_DETECTION
|
|
1020
|
+
: types_1.HB3DetectionTypes.ALL_OTHER_MOTION);
|
|
631
1021
|
}
|
|
632
1022
|
catch (err) {
|
|
633
1023
|
const error = (0, error_2.ensureError)(err);
|
|
634
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - HB3 motion detection type Error", {
|
|
1024
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - HB3 motion detection type Error", {
|
|
1025
|
+
error: (0, utils_3.getError)(error),
|
|
1026
|
+
deviceSN: this.getSerial(),
|
|
1027
|
+
property: property,
|
|
1028
|
+
value: value,
|
|
1029
|
+
});
|
|
635
1030
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
636
1031
|
}
|
|
637
1032
|
}
|
|
638
1033
|
else if ((property.name === types_1.PropertyName.DeviceMotionDetectionTypeHuman ||
|
|
639
1034
|
property.name === types_1.PropertyName.DeviceMotionDetectionTypeVehicle ||
|
|
640
|
-
property.name === types_1.PropertyName.DeviceMotionDetectionTypeAllOtherMotions) &&
|
|
1035
|
+
property.name === types_1.PropertyName.DeviceMotionDetectionTypeAllOtherMotions) &&
|
|
1036
|
+
this.isOutdoorPanAndTiltCamera()) {
|
|
641
1037
|
const booleanProperty = property;
|
|
642
1038
|
try {
|
|
643
|
-
return (0, utils_1.isT8170DetectionModeEnabled)(Number.parseInt(value), property.name === types_1.PropertyName.DeviceMotionDetectionTypeHuman
|
|
1039
|
+
return (0, utils_1.isT8170DetectionModeEnabled)(Number.parseInt(value), property.name === types_1.PropertyName.DeviceMotionDetectionTypeHuman
|
|
1040
|
+
? types_1.T8170DetectionTypes.HUMAN_DETECTION
|
|
1041
|
+
: property.name === types_1.PropertyName.DeviceMotionDetectionTypeVehicle
|
|
1042
|
+
? types_1.T8170DetectionTypes.VEHICLE_DETECTION
|
|
1043
|
+
: types_1.T8170DetectionTypes.ALL_OTHER_MOTION);
|
|
644
1044
|
}
|
|
645
1045
|
catch (err) {
|
|
646
1046
|
const error = (0, error_2.ensureError)(err);
|
|
647
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - T8170 motion detection type Error", {
|
|
1047
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - T8170 motion detection type Error", {
|
|
1048
|
+
error: (0, utils_3.getError)(error),
|
|
1049
|
+
deviceSN: this.getSerial(),
|
|
1050
|
+
property: property,
|
|
1051
|
+
value: value,
|
|
1052
|
+
});
|
|
648
1053
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
649
1054
|
}
|
|
650
1055
|
}
|
|
651
1056
|
else if ((property.name === types_1.PropertyName.DeviceMotionDetectionTypeHuman ||
|
|
652
1057
|
property.name === types_1.PropertyName.DeviceMotionDetectionTypePet ||
|
|
653
|
-
property.name === types_1.PropertyName.
|
|
1058
|
+
property.name === types_1.PropertyName.DeviceMotionDetectionTypeVehicle ||
|
|
1059
|
+
property.name === types_1.PropertyName.DeviceMotionDetectionTypeAllOtherMotions) &&
|
|
1060
|
+
this.isCameraC35()) {
|
|
654
1061
|
const booleanProperty = property;
|
|
655
1062
|
try {
|
|
656
|
-
return (0, utils_1.
|
|
1063
|
+
return (0, utils_1.isT8110DetectionModeEnabled)(Number.parseInt(value), property.name === types_1.PropertyName.DeviceMotionDetectionTypeHuman
|
|
1064
|
+
? types_1.EufyCamC35DetectionTypes.HUMAN_DETECTION
|
|
1065
|
+
: property.name === types_1.PropertyName.DeviceMotionDetectionTypePet
|
|
1066
|
+
? types_1.EufyCamC35DetectionTypes.PET_DETECTION
|
|
1067
|
+
: property.name === types_1.PropertyName.DeviceMotionDetectionTypeVehicle
|
|
1068
|
+
? types_1.EufyCamC35DetectionTypes.VEHICLE_DETECTION
|
|
1069
|
+
: types_1.EufyCamC35DetectionTypes.ALL_OTHER_MOTION);
|
|
657
1070
|
}
|
|
658
1071
|
catch (err) {
|
|
659
1072
|
const error = (0, error_2.ensureError)(err);
|
|
660
|
-
logging_1.rootHTTPLogger.error("Device convert raw property -
|
|
1073
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - T8110 motion detection type Error", {
|
|
1074
|
+
error: (0, utils_3.getError)(error),
|
|
1075
|
+
deviceSN: this.getSerial(),
|
|
1076
|
+
property: property,
|
|
1077
|
+
value: value,
|
|
1078
|
+
});
|
|
661
1079
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
662
1080
|
}
|
|
663
1081
|
}
|
|
664
1082
|
else if ((property.name === types_1.PropertyName.DeviceMotionDetectionTypeHuman ||
|
|
665
|
-
property.name === types_1.PropertyName.
|
|
1083
|
+
property.name === types_1.PropertyName.DeviceMotionDetectionTypePet ||
|
|
1084
|
+
property.name === types_1.PropertyName.DeviceMotionDetectionTypeAllOtherMotions) &&
|
|
1085
|
+
this.isIndoorPanAndTiltCameraS350()) {
|
|
666
1086
|
const booleanProperty = property;
|
|
667
1087
|
try {
|
|
668
|
-
return
|
|
1088
|
+
return (0, utils_1.isIndoorS350DetectionModeEnabled)(Number.parseInt(value), property.name === types_1.PropertyName.DeviceMotionDetectionTypeHuman
|
|
1089
|
+
? types_1.IndoorS350DetectionTypes.HUMAN_DETECTION
|
|
1090
|
+
: property.name === types_1.PropertyName.DeviceMotionDetectionTypePet
|
|
1091
|
+
? types_1.IndoorS350DetectionTypes.PET_DETECTION
|
|
1092
|
+
: types_1.IndoorS350DetectionTypes.ALL_OTHER_MOTION);
|
|
669
1093
|
}
|
|
670
1094
|
catch (err) {
|
|
671
1095
|
const error = (0, error_2.ensureError)(err);
|
|
672
|
-
logging_1.rootHTTPLogger.error("Device convert raw property -
|
|
1096
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - T8416 motion detection type Error", {
|
|
1097
|
+
error: (0, utils_3.getError)(error),
|
|
1098
|
+
deviceSN: this.getSerial(),
|
|
1099
|
+
property: property,
|
|
1100
|
+
value: value,
|
|
1101
|
+
});
|
|
1102
|
+
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
else if ((property.name === types_1.PropertyName.DeviceMotionDetectionTypeHuman ||
|
|
1106
|
+
property.name === types_1.PropertyName.DeviceMotionDetectionTypeAllOtherMotions) &&
|
|
1107
|
+
this.isSoloCameras()) {
|
|
1108
|
+
const booleanProperty = property;
|
|
1109
|
+
try {
|
|
1110
|
+
return property.name === types_1.PropertyName.DeviceMotionDetectionTypeHuman
|
|
1111
|
+
? types_1.SoloCameraDetectionTypes.HUMAN_DETECTION === Number.parseInt(value)
|
|
1112
|
+
: types_1.SoloCameraDetectionTypes.ALL_OTHER_MOTION === Number.parseInt(value);
|
|
1113
|
+
}
|
|
1114
|
+
catch (err) {
|
|
1115
|
+
const error = (0, error_2.ensureError)(err);
|
|
1116
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - SoloCamera motion detection type Error", {
|
|
1117
|
+
error: (0, utils_3.getError)(error),
|
|
1118
|
+
deviceSN: this.getSerial(),
|
|
1119
|
+
property: property,
|
|
1120
|
+
value: value,
|
|
1121
|
+
});
|
|
673
1122
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
674
1123
|
}
|
|
675
1124
|
}
|
|
@@ -677,28 +1126,54 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
677
1126
|
property.name === types_1.PropertyName.DeviceNotificationPerson ||
|
|
678
1127
|
property.name === types_1.PropertyName.DeviceNotificationPet ||
|
|
679
1128
|
property.name === types_1.PropertyName.DeviceNotificationCrying ||
|
|
680
|
-
property.name === types_1.PropertyName.DeviceNotificationAllSound) &&
|
|
1129
|
+
property.name === types_1.PropertyName.DeviceNotificationAllSound) &&
|
|
1130
|
+
this.isIndoorPanAndTiltCameraS350()) {
|
|
681
1131
|
const booleanProperty = property;
|
|
682
1132
|
try {
|
|
683
|
-
return (0, utils_1.isIndoorNotitficationEnabled)(Number.parseInt(value), property.name === types_1.PropertyName.DeviceNotificationAllOtherMotion
|
|
1133
|
+
return (0, utils_1.isIndoorNotitficationEnabled)(Number.parseInt(value), property.name === types_1.PropertyName.DeviceNotificationAllOtherMotion
|
|
1134
|
+
? types_1.IndoorS350NotificationTypes.ALL_OTHER_MOTION
|
|
1135
|
+
: property.name === types_1.PropertyName.DeviceNotificationPerson
|
|
1136
|
+
? types_1.IndoorS350NotificationTypes.HUMAN
|
|
1137
|
+
: property.name === types_1.PropertyName.DeviceNotificationPet
|
|
1138
|
+
? types_1.IndoorS350NotificationTypes.PET
|
|
1139
|
+
: property.name === types_1.PropertyName.DeviceNotificationCrying
|
|
1140
|
+
? types_1.IndoorS350NotificationTypes.CRYING
|
|
1141
|
+
: types_1.IndoorS350NotificationTypes.ALL_SOUND);
|
|
684
1142
|
}
|
|
685
1143
|
catch (err) {
|
|
686
1144
|
const error = (0, error_2.ensureError)(err);
|
|
687
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - IndoorPanAndTiltCameraS350 notification Error", {
|
|
1145
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - IndoorPanAndTiltCameraS350 notification Error", {
|
|
1146
|
+
error: (0, utils_3.getError)(error),
|
|
1147
|
+
deviceSN: this.getSerial(),
|
|
1148
|
+
property: property,
|
|
1149
|
+
value: value,
|
|
1150
|
+
});
|
|
688
1151
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
689
1152
|
}
|
|
690
1153
|
}
|
|
691
1154
|
else if ((property.name === types_1.PropertyName.DeviceNotificationAllOtherMotion ||
|
|
692
1155
|
property.name === types_1.PropertyName.DeviceNotificationPerson ||
|
|
693
1156
|
property.name === types_1.PropertyName.DeviceNotificationPet ||
|
|
694
|
-
property.name === types_1.PropertyName.DeviceNotificationVehicle) &&
|
|
1157
|
+
property.name === types_1.PropertyName.DeviceNotificationVehicle) &&
|
|
1158
|
+
(this.isFloodLightT8425() || this.isCameraC35())) {
|
|
695
1159
|
const booleanProperty = property;
|
|
696
1160
|
try {
|
|
697
|
-
return (0, utils_1.isFloodlightT8425NotitficationEnabled)(Number.parseInt(value), property.name === types_1.PropertyName.DeviceNotificationAllOtherMotion
|
|
1161
|
+
return (0, utils_1.isFloodlightT8425NotitficationEnabled)(Number.parseInt(value), property.name === types_1.PropertyName.DeviceNotificationAllOtherMotion
|
|
1162
|
+
? types_1.FloodlightT8425NotificationTypes.ALL_OTHER_MOTION
|
|
1163
|
+
: property.name === types_1.PropertyName.DeviceNotificationPerson
|
|
1164
|
+
? types_1.FloodlightT8425NotificationTypes.HUMAN
|
|
1165
|
+
: property.name === types_1.PropertyName.DeviceNotificationPet
|
|
1166
|
+
? types_1.FloodlightT8425NotificationTypes.PET
|
|
1167
|
+
: types_1.FloodlightT8425NotificationTypes.VEHICLE);
|
|
698
1168
|
}
|
|
699
1169
|
catch (err) {
|
|
700
1170
|
const error = (0, error_2.ensureError)(err);
|
|
701
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - FloodLightT8425 notification Error", {
|
|
1171
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - FloodLightT8425 or EufyCamC35 notification Error", {
|
|
1172
|
+
error: (0, utils_3.getError)(error),
|
|
1173
|
+
deviceSN: this.getSerial(),
|
|
1174
|
+
property: property,
|
|
1175
|
+
value: value,
|
|
1176
|
+
});
|
|
702
1177
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
703
1178
|
}
|
|
704
1179
|
}
|
|
@@ -706,19 +1181,35 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
706
1181
|
switch (property.name) {
|
|
707
1182
|
case types_1.PropertyName.DeviceCellularSignal: {
|
|
708
1183
|
const stringProperty = property;
|
|
709
|
-
return value !== undefined && value.Signal !== undefined
|
|
1184
|
+
return value !== undefined && value.Signal !== undefined
|
|
1185
|
+
? String(value.Signal)
|
|
1186
|
+
: stringProperty.default !== undefined
|
|
1187
|
+
? stringProperty.default
|
|
1188
|
+
: "";
|
|
710
1189
|
}
|
|
711
1190
|
case types_1.PropertyName.DeviceCellularBand: {
|
|
712
1191
|
const stringProperty = property;
|
|
713
|
-
return value !== undefined && value.band !== undefined
|
|
1192
|
+
return value !== undefined && value.band !== undefined
|
|
1193
|
+
? String(value.band)
|
|
1194
|
+
: stringProperty.default !== undefined
|
|
1195
|
+
? stringProperty.default
|
|
1196
|
+
: "";
|
|
714
1197
|
}
|
|
715
1198
|
case types_1.PropertyName.DeviceCellularIMEI: {
|
|
716
1199
|
const stringProperty = property;
|
|
717
|
-
return value !== undefined && value.imei !== undefined
|
|
1200
|
+
return value !== undefined && value.imei !== undefined
|
|
1201
|
+
? String(value.imei)
|
|
1202
|
+
: stringProperty.default !== undefined
|
|
1203
|
+
? stringProperty.default
|
|
1204
|
+
: "";
|
|
718
1205
|
}
|
|
719
1206
|
case types_1.PropertyName.DeviceCellularICCID: {
|
|
720
1207
|
const stringProperty = property;
|
|
721
|
-
return value !== undefined && value.iccid !== undefined
|
|
1208
|
+
return value !== undefined && value.iccid !== undefined
|
|
1209
|
+
? String(value.iccid)
|
|
1210
|
+
: stringProperty.default !== undefined
|
|
1211
|
+
? stringProperty.default
|
|
1212
|
+
: "";
|
|
722
1213
|
}
|
|
723
1214
|
}
|
|
724
1215
|
}
|
|
@@ -730,12 +1221,27 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
730
1221
|
mode = quality.mode_0;
|
|
731
1222
|
}
|
|
732
1223
|
try {
|
|
733
|
-
return value !== undefined && mode !== undefined && mode.quality !== undefined
|
|
1224
|
+
return value !== undefined && mode !== undefined && mode.quality !== undefined
|
|
1225
|
+
? mode.quality
|
|
1226
|
+
: numericProperty.default !== undefined
|
|
1227
|
+
? numericProperty.default
|
|
1228
|
+
: numericProperty.min !== undefined
|
|
1229
|
+
? numericProperty.min
|
|
1230
|
+
: 0;
|
|
734
1231
|
}
|
|
735
1232
|
catch (err) {
|
|
736
1233
|
const error = (0, error_2.ensureError)(err);
|
|
737
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_BAT_DOORBELL_VIDEO_QUALITY2 Error", {
|
|
738
|
-
|
|
1234
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_BAT_DOORBELL_VIDEO_QUALITY2 Error", {
|
|
1235
|
+
error: (0, utils_3.getError)(error),
|
|
1236
|
+
deviceSN: this.getSerial(),
|
|
1237
|
+
property: property,
|
|
1238
|
+
value: value,
|
|
1239
|
+
});
|
|
1240
|
+
return numericProperty.default !== undefined
|
|
1241
|
+
? numericProperty.default
|
|
1242
|
+
: numericProperty.min !== undefined
|
|
1243
|
+
? numericProperty.min
|
|
1244
|
+
: 0;
|
|
739
1245
|
}
|
|
740
1246
|
}
|
|
741
1247
|
else if (property.key === types_2.CommandType.CMD_BAT_DOORBELL_RECORD_QUALITY2) {
|
|
@@ -746,12 +1252,27 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
746
1252
|
mode = quality.mode_0;
|
|
747
1253
|
}
|
|
748
1254
|
try {
|
|
749
|
-
return value !== undefined && mode !== undefined && mode.quality !== undefined
|
|
1255
|
+
return value !== undefined && mode !== undefined && mode.quality !== undefined
|
|
1256
|
+
? mode.quality
|
|
1257
|
+
: numericProperty.default !== undefined
|
|
1258
|
+
? numericProperty.default
|
|
1259
|
+
: numericProperty.min !== undefined
|
|
1260
|
+
? numericProperty.min
|
|
1261
|
+
: 0;
|
|
750
1262
|
}
|
|
751
1263
|
catch (err) {
|
|
752
1264
|
const error = (0, error_2.ensureError)(err);
|
|
753
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_BAT_DOORBELL_RECORD_QUALITY2 Error", {
|
|
754
|
-
|
|
1265
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - CMD_BAT_DOORBELL_RECORD_QUALITY2 Error", {
|
|
1266
|
+
error: (0, utils_3.getError)(error),
|
|
1267
|
+
deviceSN: this.getSerial(),
|
|
1268
|
+
property: property,
|
|
1269
|
+
value: value,
|
|
1270
|
+
});
|
|
1271
|
+
return numericProperty.default !== undefined
|
|
1272
|
+
? numericProperty.default
|
|
1273
|
+
: numericProperty.min !== undefined
|
|
1274
|
+
? numericProperty.min
|
|
1275
|
+
: 0;
|
|
755
1276
|
}
|
|
756
1277
|
}
|
|
757
1278
|
else if (property.key === types_2.CommandType.CMD_DEV_RECORD_AUTOSTOP && this.isCameraProfessional247()) {
|
|
@@ -762,49 +1283,117 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
762
1283
|
switch (property.name) {
|
|
763
1284
|
case types_1.PropertyName.DeviceMotionDetectionRange: {
|
|
764
1285
|
const numericProperty = property;
|
|
765
|
-
return currentValue !== undefined && currentValue.cur_mode !== undefined
|
|
1286
|
+
return currentValue !== undefined && currentValue.cur_mode !== undefined
|
|
1287
|
+
? currentValue.cur_mode
|
|
1288
|
+
: numericProperty.default !== undefined
|
|
1289
|
+
? numericProperty.default
|
|
1290
|
+
: numericProperty.min !== undefined
|
|
1291
|
+
? numericProperty.min
|
|
1292
|
+
: 0;
|
|
766
1293
|
}
|
|
767
1294
|
case types_1.PropertyName.DeviceMotionDetectionRangeStandardSensitivity: {
|
|
768
1295
|
const numericProperty = property;
|
|
769
|
-
return currentValue !== undefined &&
|
|
1296
|
+
return currentValue !== undefined &&
|
|
1297
|
+
currentValue.mode0 !== undefined &&
|
|
1298
|
+
Array.isArray(currentValue.mode0) &&
|
|
1299
|
+
currentValue.mode0.length > 0 &&
|
|
1300
|
+
currentValue.mode0.find((element) => element.id === 1) !== undefined
|
|
1301
|
+
? currentValue.mode0.find((element) => element.id === 1).sst
|
|
1302
|
+
: numericProperty.default !== undefined
|
|
1303
|
+
? numericProperty.default
|
|
1304
|
+
: numericProperty.min !== undefined
|
|
1305
|
+
? numericProperty.min
|
|
1306
|
+
: 0;
|
|
770
1307
|
}
|
|
771
1308
|
case types_1.PropertyName.DeviceMotionDetectionRangeAdvancedLeftSensitivity: {
|
|
772
1309
|
const numericProperty = property;
|
|
773
|
-
return currentValue !== undefined &&
|
|
1310
|
+
return currentValue !== undefined &&
|
|
1311
|
+
currentValue.mode1 !== undefined &&
|
|
1312
|
+
Array.isArray(currentValue.mode1) &&
|
|
1313
|
+
currentValue.mode1.length > 0 &&
|
|
1314
|
+
currentValue.mode1.find((element) => element.id === 1) !== undefined
|
|
1315
|
+
? currentValue.mode1.find((element) => element.id === 1).sst
|
|
1316
|
+
: numericProperty.default !== undefined
|
|
1317
|
+
? numericProperty.default
|
|
1318
|
+
: numericProperty.min !== undefined
|
|
1319
|
+
? numericProperty.min
|
|
1320
|
+
: 0;
|
|
774
1321
|
}
|
|
775
1322
|
case types_1.PropertyName.DeviceMotionDetectionRangeAdvancedRightSensitivity: {
|
|
776
1323
|
const numericProperty = property;
|
|
777
|
-
return currentValue !== undefined &&
|
|
1324
|
+
return currentValue !== undefined &&
|
|
1325
|
+
currentValue.mode1 !== undefined &&
|
|
1326
|
+
Array.isArray(currentValue.mode1) &&
|
|
1327
|
+
currentValue.mode1.length > 0 &&
|
|
1328
|
+
currentValue.mode1.find((element) => element.id === 2) !== undefined
|
|
1329
|
+
? currentValue.mode1.find((element) => element.id === 2).sst
|
|
1330
|
+
: numericProperty.default !== undefined
|
|
1331
|
+
? numericProperty.default
|
|
1332
|
+
: numericProperty.min !== undefined
|
|
1333
|
+
? numericProperty.min
|
|
1334
|
+
: 0;
|
|
778
1335
|
}
|
|
779
1336
|
case types_1.PropertyName.DeviceMotionDetectionTestMode: {
|
|
780
1337
|
const booleanProperty = property;
|
|
781
|
-
return currentValue !== undefined && currentValue.test_mode !== undefined
|
|
1338
|
+
return currentValue !== undefined && currentValue.test_mode !== undefined
|
|
1339
|
+
? currentValue.test_mode === 1
|
|
1340
|
+
: booleanProperty.default !== undefined
|
|
1341
|
+
? booleanProperty.default
|
|
1342
|
+
: false;
|
|
782
1343
|
}
|
|
783
1344
|
}
|
|
784
1345
|
}
|
|
785
1346
|
else if (property.key === types_2.CommandType.CMD_SET_LIGHT_CTRL_BRIGHT_SCH_T8425) {
|
|
786
1347
|
const currentValue = value;
|
|
787
1348
|
const numericProperty = property;
|
|
788
|
-
return currentValue !== undefined && currentValue.brightness !== undefined
|
|
1349
|
+
return currentValue !== undefined && currentValue.brightness !== undefined
|
|
1350
|
+
? currentValue.brightness
|
|
1351
|
+
: numericProperty.default !== undefined
|
|
1352
|
+
? numericProperty.default
|
|
1353
|
+
: numericProperty.min !== undefined
|
|
1354
|
+
? numericProperty.min
|
|
1355
|
+
: 0;
|
|
789
1356
|
}
|
|
790
1357
|
else if (property.key === types_2.CommandType.CMD_SET_LIGHT_CTRL_BRIGHT_PIR_T8425) {
|
|
791
1358
|
const currentValue = value;
|
|
792
1359
|
switch (property.name) {
|
|
793
1360
|
case types_1.PropertyName.DeviceLightSettingsBrightnessMotion: {
|
|
794
1361
|
const numericProperty = property;
|
|
795
|
-
return currentValue !== undefined && currentValue.brightness !== undefined
|
|
1362
|
+
return currentValue !== undefined && currentValue.brightness !== undefined
|
|
1363
|
+
? currentValue.brightness
|
|
1364
|
+
: numericProperty.default !== undefined
|
|
1365
|
+
? numericProperty.default
|
|
1366
|
+
: numericProperty.min !== undefined
|
|
1367
|
+
? numericProperty.min
|
|
1368
|
+
: 0;
|
|
796
1369
|
}
|
|
797
1370
|
case types_1.PropertyName.DeviceLightSettingsMotionActivationMode: {
|
|
798
1371
|
const numericProperty = property;
|
|
799
|
-
return currentValue !== undefined && currentValue.mode !== undefined
|
|
1372
|
+
return currentValue !== undefined && currentValue.mode !== undefined
|
|
1373
|
+
? currentValue.mode
|
|
1374
|
+
: numericProperty.default !== undefined
|
|
1375
|
+
? numericProperty.default
|
|
1376
|
+
: numericProperty.min !== undefined
|
|
1377
|
+
? numericProperty.min
|
|
1378
|
+
: 0;
|
|
800
1379
|
}
|
|
801
1380
|
case types_1.PropertyName.DeviceLightSettingsMotionTriggeredTimer: {
|
|
802
1381
|
const numericProperty = property;
|
|
803
|
-
return currentValue !== undefined && currentValue.time !== undefined
|
|
1382
|
+
return currentValue !== undefined && currentValue.time !== undefined
|
|
1383
|
+
? currentValue.time
|
|
1384
|
+
: numericProperty.default !== undefined
|
|
1385
|
+
? numericProperty.default
|
|
1386
|
+
: numericProperty.min !== undefined
|
|
1387
|
+
? numericProperty.min
|
|
1388
|
+
: 0;
|
|
804
1389
|
}
|
|
805
1390
|
case types_1.PropertyName.DeviceLightSettingsMotionTriggered: {
|
|
806
1391
|
const booleanProperty = property;
|
|
807
|
-
return currentValue !== undefined && currentValue.enable !== undefined
|
|
1392
|
+
return currentValue !== undefined && currentValue.enable !== undefined
|
|
1393
|
+
? currentValue.enable === 1
|
|
1394
|
+
: booleanProperty.default !== undefined
|
|
1395
|
+
? booleanProperty.default
|
|
1396
|
+
: false;
|
|
808
1397
|
}
|
|
809
1398
|
}
|
|
810
1399
|
}
|
|
@@ -812,12 +1401,29 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
812
1401
|
const numericProperty = property;
|
|
813
1402
|
try {
|
|
814
1403
|
const rawCharging = Number.parseInt(value);
|
|
815
|
-
return rawCharging !== undefined
|
|
1404
|
+
return rawCharging !== undefined
|
|
1405
|
+
? (0, utils_2.isCharging)(rawCharging)
|
|
1406
|
+
? 1
|
|
1407
|
+
: 0
|
|
1408
|
+
: numericProperty.default !== undefined
|
|
1409
|
+
? numericProperty.default
|
|
1410
|
+
: numericProperty.min !== undefined
|
|
1411
|
+
? numericProperty.min
|
|
1412
|
+
: 0;
|
|
816
1413
|
}
|
|
817
1414
|
catch (err) {
|
|
818
1415
|
const error = (0, error_2.ensureError)(err);
|
|
819
|
-
logging_1.rootHTTPLogger.warn("Device convert raw property - SUB1G_REP_UNPLUG_POWER_LINE Error", {
|
|
820
|
-
|
|
1416
|
+
logging_1.rootHTTPLogger.warn("Device convert raw property - SUB1G_REP_UNPLUG_POWER_LINE Error", {
|
|
1417
|
+
error: (0, utils_3.getError)(error),
|
|
1418
|
+
deviceSN: this.getSerial(),
|
|
1419
|
+
property: property,
|
|
1420
|
+
value: value,
|
|
1421
|
+
});
|
|
1422
|
+
return numericProperty.default !== undefined
|
|
1423
|
+
? numericProperty.default
|
|
1424
|
+
: numericProperty.min !== undefined
|
|
1425
|
+
? numericProperty.min
|
|
1426
|
+
: 0;
|
|
821
1427
|
}
|
|
822
1428
|
}
|
|
823
1429
|
else if (property.name === types_1.PropertyName.Model && this.isLockWifiT8510P()) {
|
|
@@ -826,37 +1432,68 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
826
1432
|
else if (property.type === "number") {
|
|
827
1433
|
const numericProperty = property;
|
|
828
1434
|
try {
|
|
829
|
-
return value !== undefined
|
|
1435
|
+
return value !== undefined
|
|
1436
|
+
? Number.parseInt(value)
|
|
1437
|
+
: numericProperty.default !== undefined
|
|
1438
|
+
? numericProperty.default
|
|
1439
|
+
: numericProperty.min !== undefined
|
|
1440
|
+
? numericProperty.min
|
|
1441
|
+
: 0;
|
|
830
1442
|
}
|
|
831
1443
|
catch (err) {
|
|
832
1444
|
const error = (0, error_2.ensureError)(err);
|
|
833
|
-
logging_1.rootHTTPLogger.warn("Device convert raw property - PropertyMetadataNumeric Convert Error", {
|
|
834
|
-
|
|
1445
|
+
logging_1.rootHTTPLogger.warn("Device convert raw property - PropertyMetadataNumeric Convert Error", {
|
|
1446
|
+
error: (0, utils_3.getError)(error),
|
|
1447
|
+
deviceSN: this.getSerial(),
|
|
1448
|
+
property: property,
|
|
1449
|
+
value: value,
|
|
1450
|
+
});
|
|
1451
|
+
return numericProperty.default !== undefined
|
|
1452
|
+
? numericProperty.default
|
|
1453
|
+
: numericProperty.min !== undefined
|
|
1454
|
+
? numericProperty.min
|
|
1455
|
+
: 0;
|
|
835
1456
|
}
|
|
836
1457
|
}
|
|
837
1458
|
else if (property.type === "boolean") {
|
|
838
1459
|
const booleanProperty = property;
|
|
839
1460
|
try {
|
|
840
|
-
return value !== undefined
|
|
1461
|
+
return value !== undefined
|
|
1462
|
+
? typeof value === "number"
|
|
1463
|
+
? !!value
|
|
1464
|
+
: value === "1" || value.toLowerCase() === "true"
|
|
1465
|
+
: booleanProperty.default !== undefined
|
|
1466
|
+
? booleanProperty.default
|
|
1467
|
+
: false;
|
|
841
1468
|
}
|
|
842
1469
|
catch (err) {
|
|
843
1470
|
const error = (0, error_2.ensureError)(err);
|
|
844
|
-
logging_1.rootHTTPLogger.warn("Device convert raw property - PropertyMetadataBoolean Convert Error", {
|
|
1471
|
+
logging_1.rootHTTPLogger.warn("Device convert raw property - PropertyMetadataBoolean Convert Error", {
|
|
1472
|
+
error: (0, utils_3.getError)(error),
|
|
1473
|
+
deviceSN: this.getSerial(),
|
|
1474
|
+
property: property,
|
|
1475
|
+
value: value,
|
|
1476
|
+
});
|
|
845
1477
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
846
1478
|
}
|
|
847
1479
|
}
|
|
848
1480
|
else if (property.type === "string") {
|
|
849
1481
|
const stringProperty = property;
|
|
850
|
-
return value !== undefined ? value :
|
|
1482
|
+
return value !== undefined ? value : stringProperty.default !== undefined ? stringProperty.default : "";
|
|
851
1483
|
}
|
|
852
1484
|
else if (property.type === "object") {
|
|
853
1485
|
const objectProperty = property;
|
|
854
|
-
return value !== undefined ? value :
|
|
1486
|
+
return value !== undefined ? value : objectProperty.default !== undefined ? objectProperty.default : undefined;
|
|
855
1487
|
}
|
|
856
1488
|
}
|
|
857
1489
|
catch (err) {
|
|
858
1490
|
const error = (0, error_2.ensureError)(err);
|
|
859
|
-
logging_1.rootHTTPLogger.error("Device convert raw property - Error", {
|
|
1491
|
+
logging_1.rootHTTPLogger.error("Device convert raw property - Error", {
|
|
1492
|
+
error: (0, utils_3.getError)(error),
|
|
1493
|
+
deviceSN: this.getSerial(),
|
|
1494
|
+
property: property,
|
|
1495
|
+
value: value,
|
|
1496
|
+
});
|
|
860
1497
|
}
|
|
861
1498
|
return value;
|
|
862
1499
|
}
|
|
@@ -888,54 +1525,70 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
888
1525
|
}
|
|
889
1526
|
getPropertiesMetadata(hidden = false) {
|
|
890
1527
|
let metadata = {
|
|
891
|
-
...types_1.DeviceProperties[this.getDeviceType()]
|
|
1528
|
+
...types_1.DeviceProperties[this.getDeviceType()],
|
|
892
1529
|
};
|
|
893
1530
|
if (this.isFloodLightT8420X()) {
|
|
894
1531
|
metadata = {
|
|
895
|
-
...types_1.FloodlightT8420XDeviceProperties
|
|
1532
|
+
...types_1.FloodlightT8420XDeviceProperties,
|
|
896
1533
|
};
|
|
897
1534
|
}
|
|
898
1535
|
else if (this.isWiredDoorbellT8200X()) {
|
|
899
1536
|
metadata = {
|
|
900
|
-
...types_1.WiredDoorbellT8200XDeviceProperties
|
|
1537
|
+
...types_1.WiredDoorbellT8200XDeviceProperties,
|
|
901
1538
|
};
|
|
902
1539
|
}
|
|
903
1540
|
else if (this.isLockWifiT8510P()) {
|
|
904
1541
|
metadata = {
|
|
905
|
-
...types_1.LockT8510PDeviceProperties
|
|
1542
|
+
...types_1.LockT8510PDeviceProperties,
|
|
906
1543
|
};
|
|
907
|
-
metadata[types_1.PropertyName.Type].states[this.getDeviceType()] =
|
|
1544
|
+
metadata[types_1.PropertyName.Type].states[this.getDeviceType()] =
|
|
1545
|
+
"Smart Lock S230 (T8510P)";
|
|
908
1546
|
}
|
|
909
1547
|
else if (this.isLockWifiT8520P()) {
|
|
910
1548
|
metadata = {
|
|
911
|
-
...types_1.LockT8520PDeviceProperties
|
|
1549
|
+
...types_1.LockT8520PDeviceProperties,
|
|
912
1550
|
};
|
|
913
|
-
metadata[types_1.PropertyName.Type].states[this.getDeviceType()] =
|
|
1551
|
+
metadata[types_1.PropertyName.Type].states[this.getDeviceType()] =
|
|
1552
|
+
"Smart Lock S231 (T8520P)";
|
|
914
1553
|
}
|
|
915
|
-
else if (this.isSoloCameras() && station_1.Station.
|
|
1554
|
+
else if (this.isSoloCameras() && station_1.Station.isDeviceControlledByHomeBaseBySn(this.getStationSerial())) {
|
|
916
1555
|
const newMetadata = {
|
|
917
|
-
...metadata
|
|
1556
|
+
...metadata,
|
|
918
1557
|
};
|
|
919
1558
|
newMetadata[types_1.PropertyName.DeviceAudioRecording] = types_1.DeviceAudioRecordingProperty;
|
|
920
1559
|
newMetadata[types_1.PropertyName.DeviceMotionDetectionSensitivity] = types_1.DeviceMotionDetectionSensitivityCamera2Property;
|
|
921
|
-
|
|
1560
|
+
if (this.isCameraC35()) {
|
|
1561
|
+
newMetadata[types_1.PropertyName.DeviceVideoRecordingQuality] = types_1.DeviceVideoRecordingQualityCameraC35HB3Property;
|
|
1562
|
+
}
|
|
1563
|
+
else {
|
|
1564
|
+
newMetadata[types_1.PropertyName.DeviceVideoRecordingQuality] = types_1.DeviceVideoRecordingQualitySoloCamerasHB3Property;
|
|
1565
|
+
}
|
|
922
1566
|
newMetadata[types_1.PropertyName.DeviceNotificationType] = types_1.DeviceNotificationTypeProperty;
|
|
923
1567
|
newMetadata[types_1.PropertyName.DeviceMotionDetection] = types_1.DeviceMotionDetectionProperty;
|
|
1568
|
+
if (this.isCameraC35()) {
|
|
1569
|
+
newMetadata[types_1.PropertyName.DeviceRTSPStream] = types_1.DeviceRTSPStreamProperty;
|
|
1570
|
+
newMetadata[types_1.PropertyName.DeviceRTSPStreamUrl] = types_1.DeviceRTSPStreamUrlProperty;
|
|
1571
|
+
}
|
|
924
1572
|
metadata = newMetadata;
|
|
925
1573
|
}
|
|
926
|
-
else if (this.isIndoorPanAndTiltCameraS350() &&
|
|
1574
|
+
else if (this.isIndoorPanAndTiltCameraS350() &&
|
|
1575
|
+
station_1.Station.isDeviceControlledByHomeBaseBySn(this.getStationSerial())) {
|
|
927
1576
|
const newMetadata = {
|
|
928
|
-
...metadata
|
|
1577
|
+
...metadata,
|
|
929
1578
|
};
|
|
930
1579
|
newMetadata[types_1.PropertyName.DeviceMotionDetection] = types_1.DeviceMotionDetectionProperty;
|
|
931
1580
|
newMetadata[types_1.PropertyName.DeviceAudioRecording] = types_1.DeviceAudioRecordingProperty;
|
|
932
|
-
newMetadata[types_1.PropertyName.DeviceMotionDetectionSensitivity] =
|
|
1581
|
+
newMetadata[types_1.PropertyName.DeviceMotionDetectionSensitivity] =
|
|
1582
|
+
types_1.DeviceMotionDetectionSensitivityBatteryDoorbellProperty;
|
|
933
1583
|
newMetadata[types_1.PropertyName.DeviceStatusLed] = types_1.DeviceStatusLedIndoorS350Property;
|
|
934
1584
|
metadata = newMetadata;
|
|
935
1585
|
}
|
|
936
|
-
if (station_1.Station.
|
|
1586
|
+
if (station_1.Station.isDeviceControlledByHomeBaseBySn(this.getStationSerial()) &&
|
|
1587
|
+
(metadata[types_1.PropertyName.DeviceMotionDetectionType] !== undefined ||
|
|
1588
|
+
metadata[types_1.PropertyName.DeviceMotionDetectionTypeAllOtherMotions] !== undefined) &&
|
|
1589
|
+
this.isCamera()) {
|
|
937
1590
|
const newMetadata = {
|
|
938
|
-
...metadata
|
|
1591
|
+
...metadata,
|
|
939
1592
|
};
|
|
940
1593
|
delete newMetadata[types_1.PropertyName.DeviceMotionDetectionType];
|
|
941
1594
|
delete newMetadata[types_1.PropertyName.DeviceLastChargingDays];
|
|
@@ -944,10 +1597,12 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
944
1597
|
delete newMetadata[types_1.PropertyName.DeviceLastChargingTotalEvents];
|
|
945
1598
|
delete newMetadata[types_1.PropertyName.DeviceBatteryUsageLastWeek];
|
|
946
1599
|
newMetadata[types_1.PropertyName.DeviceMotionDetectionTypeHuman] = types_1.DeviceMotionHB3DetectionTypeHumanProperty;
|
|
947
|
-
newMetadata[types_1.PropertyName.DeviceMotionDetectionTypeHumanRecognition] =
|
|
1600
|
+
newMetadata[types_1.PropertyName.DeviceMotionDetectionTypeHumanRecognition] =
|
|
1601
|
+
types_1.DeviceMotionHB3DetectionTypeHumanRecognitionProperty;
|
|
948
1602
|
newMetadata[types_1.PropertyName.DeviceMotionDetectionTypePet] = types_1.DeviceMotionHB3DetectionTypePetProperty;
|
|
949
1603
|
newMetadata[types_1.PropertyName.DeviceMotionDetectionTypeVehicle] = types_1.DeviceMotionHB3DetectionTypeVehicleProperty;
|
|
950
|
-
newMetadata[types_1.PropertyName.DeviceMotionDetectionTypeAllOtherMotions] =
|
|
1604
|
+
newMetadata[types_1.PropertyName.DeviceMotionDetectionTypeAllOtherMotions] =
|
|
1605
|
+
types_1.DeviceMotionHB3DetectionTypeAllOtherMotionsProperty;
|
|
951
1606
|
newMetadata[types_1.PropertyName.DevicePersonDetected] = types_1.DevicePersonDetectedProperty;
|
|
952
1607
|
newMetadata[types_1.PropertyName.DeviceMotionDetected] = types_1.DeviceMotionDetectedProperty;
|
|
953
1608
|
newMetadata[types_1.PropertyName.DevicePetDetected] = types_1.DevicePetDetectedProperty;
|
|
@@ -960,8 +1615,10 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
960
1615
|
newMetadata[types_1.PropertyName.DeviceDogLickDetected] = types_1.DeviceDogLickDetectedProperty;
|
|
961
1616
|
newMetadata[types_1.PropertyName.DeviceDogPoopDetected] = types_1.DeviceDogPoopDetectedProperty;
|
|
962
1617
|
newMetadata[types_1.PropertyName.DeviceDetectionStatisticsWorkingDays] = types_1.DeviceDetectionStatisticsWorkingDaysProperty;
|
|
963
|
-
newMetadata[types_1.PropertyName.DeviceDetectionStatisticsDetectedEvents] =
|
|
964
|
-
|
|
1618
|
+
newMetadata[types_1.PropertyName.DeviceDetectionStatisticsDetectedEvents] =
|
|
1619
|
+
types_1.DeviceDetectionStatisticsDetectedEventsProperty;
|
|
1620
|
+
newMetadata[types_1.PropertyName.DeviceDetectionStatisticsRecordedEvents] =
|
|
1621
|
+
types_1.DeviceDetectionStatisticsRecordedEventsProperty;
|
|
965
1622
|
if (!this.isSmartDrop()) {
|
|
966
1623
|
//TODO: Check with future devices if this property overriding is correct (for example with indoor cameras etc.)
|
|
967
1624
|
newMetadata[types_1.PropertyName.DeviceEnabled] = types_1.DeviceEnabledSoloProperty;
|
|
@@ -970,7 +1627,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
970
1627
|
}
|
|
971
1628
|
else if (Object.keys(metadata).length === 0) {
|
|
972
1629
|
metadata = {
|
|
973
|
-
...types_1.GenericDeviceProperties
|
|
1630
|
+
...types_1.GenericDeviceProperties,
|
|
974
1631
|
};
|
|
975
1632
|
}
|
|
976
1633
|
if (!hidden) {
|
|
@@ -1023,7 +1680,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1023
1680
|
return types_1.DeviceProperties[type] !== undefined;
|
|
1024
1681
|
}
|
|
1025
1682
|
static isCamera(type) {
|
|
1026
|
-
return type == types_1.DeviceType.CAMERA ||
|
|
1683
|
+
return (type == types_1.DeviceType.CAMERA ||
|
|
1027
1684
|
type == types_1.DeviceType.CAMERA2 ||
|
|
1028
1685
|
type == types_1.DeviceType.CAMERA_E ||
|
|
1029
1686
|
type == types_1.DeviceType.CAMERA2C ||
|
|
@@ -1040,6 +1697,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1040
1697
|
type == types_1.DeviceType.DOORBELL_SOLO ||
|
|
1041
1698
|
type == types_1.DeviceType.CAMERA2C_PRO ||
|
|
1042
1699
|
type == types_1.DeviceType.CAMERA2_PRO ||
|
|
1700
|
+
type == types_1.DeviceType.CAMERA_E40 ||
|
|
1043
1701
|
type == types_1.DeviceType.CAMERA3 ||
|
|
1044
1702
|
type == types_1.DeviceType.CAMERA3C ||
|
|
1045
1703
|
type == types_1.DeviceType.CAMERA3_PRO ||
|
|
@@ -1076,10 +1734,10 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1076
1734
|
type == types_1.DeviceType.INDOOR_PT_CAMERA_C210 ||
|
|
1077
1735
|
type == types_1.DeviceType.INDOOR_PT_CAMERA_C220 ||
|
|
1078
1736
|
type == types_1.DeviceType.INDOOR_PT_CAMERA_C220_V2 ||
|
|
1079
|
-
type == types_1.DeviceType.SMART_DROP;
|
|
1737
|
+
type == types_1.DeviceType.SMART_DROP);
|
|
1080
1738
|
}
|
|
1081
1739
|
static hasBattery(type) {
|
|
1082
|
-
return type == types_1.DeviceType.CAMERA ||
|
|
1740
|
+
return (type == types_1.DeviceType.CAMERA ||
|
|
1083
1741
|
type == types_1.DeviceType.CAMERA2 ||
|
|
1084
1742
|
type == types_1.DeviceType.CAMERA_E ||
|
|
1085
1743
|
type == types_1.DeviceType.CAMERA2C ||
|
|
@@ -1091,6 +1749,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1091
1749
|
type == types_1.DeviceType.BATTERY_DOORBELL_C31 ||
|
|
1092
1750
|
type == types_1.DeviceType.CAMERA2C_PRO ||
|
|
1093
1751
|
type == types_1.DeviceType.CAMERA2_PRO ||
|
|
1752
|
+
type == types_1.DeviceType.CAMERA_E40 ||
|
|
1094
1753
|
type == types_1.DeviceType.CAMERA3 ||
|
|
1095
1754
|
type == types_1.DeviceType.CAMERA3C ||
|
|
1096
1755
|
type == types_1.DeviceType.CAMERA3_PRO ||
|
|
@@ -1119,12 +1778,14 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1119
1778
|
type == types_1.DeviceType.CAMERA_FG ||
|
|
1120
1779
|
type == types_1.DeviceType.WALL_LIGHT_CAM_81A0 ||
|
|
1121
1780
|
type == types_1.DeviceType.SMART_DROP ||
|
|
1122
|
-
type == types_1.DeviceType.OUTDOOR_PT_CAMERA
|
|
1781
|
+
type == types_1.DeviceType.OUTDOOR_PT_CAMERA ||
|
|
1782
|
+
type == types_1.DeviceType.ENTRY_SENSOR_E20);
|
|
1123
1783
|
}
|
|
1124
1784
|
static isStation(type) {
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1785
|
+
return (type === types_1.DeviceType.STATION ||
|
|
1786
|
+
type === types_1.DeviceType.HB3 ||
|
|
1787
|
+
type === types_1.DeviceType.HOMEBASE_MINI ||
|
|
1788
|
+
type === types_1.DeviceType.MINIBASE_CHIME);
|
|
1128
1789
|
}
|
|
1129
1790
|
static isCamera1(type) {
|
|
1130
1791
|
return types_1.DeviceType.CAMERA == type;
|
|
@@ -1133,11 +1794,13 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1133
1794
|
return types_1.DeviceType.CAMERA_E == type;
|
|
1134
1795
|
}
|
|
1135
1796
|
static isSensor(type) {
|
|
1136
|
-
if (type == types_1.DeviceType.SENSOR ||
|
|
1137
|
-
type == types_1.DeviceType.MOTION_SENSOR)
|
|
1797
|
+
if (type == types_1.DeviceType.SENSOR || type == types_1.DeviceType.MOTION_SENSOR || type == types_1.DeviceType.ENTRY_SENSOR_E20)
|
|
1138
1798
|
return true;
|
|
1139
1799
|
return false;
|
|
1140
1800
|
}
|
|
1801
|
+
static isEntryE20(type) {
|
|
1802
|
+
return types_1.DeviceType.ENTRY_SENSOR_E20 == type;
|
|
1803
|
+
}
|
|
1141
1804
|
static isKeyPad(type) {
|
|
1142
1805
|
return types_1.DeviceType.KEYPAD == type;
|
|
1143
1806
|
}
|
|
@@ -1159,7 +1822,10 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1159
1822
|
return false;
|
|
1160
1823
|
}
|
|
1161
1824
|
static isWiredDoorbellT8200X(type, serialnumber) {
|
|
1162
|
-
if (type == types_1.DeviceType.DOORBELL &&
|
|
1825
|
+
if (type == types_1.DeviceType.DOORBELL &&
|
|
1826
|
+
serialnumber.startsWith("T8200") &&
|
|
1827
|
+
serialnumber.length > 7 &&
|
|
1828
|
+
serialnumber.charAt(6) === "6")
|
|
1163
1829
|
return true;
|
|
1164
1830
|
return false;
|
|
1165
1831
|
}
|
|
@@ -1202,8 +1868,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1202
1868
|
return false;
|
|
1203
1869
|
}
|
|
1204
1870
|
static isOutdoorPanAndTiltCamera(type) {
|
|
1205
|
-
if (type == types_1.DeviceType.OUTDOOR_PT_CAMERA ||
|
|
1206
|
-
type == types_1.DeviceType.SOLO_CAMERA_E30)
|
|
1871
|
+
if (type == types_1.DeviceType.OUTDOOR_PT_CAMERA || type == types_1.DeviceType.SOLO_CAMERA_E30)
|
|
1207
1872
|
return true;
|
|
1208
1873
|
return false;
|
|
1209
1874
|
}
|
|
@@ -1212,8 +1877,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1212
1877
|
type == types_1.DeviceType.INDOOR_PT_CAMERA_E30 ||
|
|
1213
1878
|
type == types_1.DeviceType.INDOOR_PT_CAMERA_C210 ||
|
|
1214
1879
|
type == types_1.DeviceType.INDOOR_PT_CAMERA_C220 ||
|
|
1215
|
-
type == types_1.DeviceType.INDOOR_PT_CAMERA_C220_V2
|
|
1216
|
-
type == types_1.DeviceType.INDOOR_PT_CAMERA)
|
|
1880
|
+
type == types_1.DeviceType.INDOOR_PT_CAMERA_C220_V2)
|
|
1217
1881
|
return true;
|
|
1218
1882
|
return false;
|
|
1219
1883
|
}
|
|
@@ -1228,7 +1892,10 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1228
1892
|
return false;
|
|
1229
1893
|
}
|
|
1230
1894
|
static isFloodLightT8420X(type, serialnumber) {
|
|
1231
|
-
if (type == types_1.DeviceType.FLOODLIGHT &&
|
|
1895
|
+
if (type == types_1.DeviceType.FLOODLIGHT &&
|
|
1896
|
+
serialnumber.startsWith("T8420") &&
|
|
1897
|
+
serialnumber.length > 7 &&
|
|
1898
|
+
serialnumber.charAt(6) === "6")
|
|
1232
1899
|
return true;
|
|
1233
1900
|
return false;
|
|
1234
1901
|
}
|
|
@@ -1243,7 +1910,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1243
1910
|
return false;
|
|
1244
1911
|
}
|
|
1245
1912
|
static isFloodLightT8426(type) {
|
|
1246
|
-
return
|
|
1913
|
+
return type == types_1.DeviceType.FLOODLIGHT_CAMERA_8426;
|
|
1247
1914
|
}
|
|
1248
1915
|
static isWallLightCam(type) {
|
|
1249
1916
|
if (type == types_1.DeviceType.WALL_LIGHT_CAM || type == types_1.DeviceType.WALL_LIGHT_CAM_81A0)
|
|
@@ -1251,7 +1918,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1251
1918
|
return false;
|
|
1252
1919
|
}
|
|
1253
1920
|
static isLock(type) {
|
|
1254
|
-
return Device.isLockBle(type) ||
|
|
1921
|
+
return (Device.isLockBle(type) ||
|
|
1255
1922
|
Device.isLockWifi(type, "") ||
|
|
1256
1923
|
Device.isLockBleNoFinger(type) ||
|
|
1257
1924
|
Device.isLockWifiNoFinger(type) ||
|
|
@@ -1259,7 +1926,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1259
1926
|
Device.isLockWifiR20(type) ||
|
|
1260
1927
|
Device.isLockWifiVideo(type) ||
|
|
1261
1928
|
Device.isLockWifiT8506(type) ||
|
|
1262
|
-
Device.isLockWifiT8502(type);
|
|
1929
|
+
Device.isLockWifiT8502(type));
|
|
1263
1930
|
}
|
|
1264
1931
|
static isLockKeypad(type) {
|
|
1265
1932
|
return Device.isLockWifiR10Keypad(type) || Device.isLockWifiR20Keypad(type);
|
|
@@ -1271,7 +1938,9 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1271
1938
|
return types_1.DeviceType.LOCK_BLE_NO_FINGER == type;
|
|
1272
1939
|
}
|
|
1273
1940
|
static isLockWifi(type, serialnumber) {
|
|
1274
|
-
return types_1.DeviceType.LOCK_WIFI == type &&
|
|
1941
|
+
return (types_1.DeviceType.LOCK_WIFI == type &&
|
|
1942
|
+
!Device.isLockWifiT8510P(type, serialnumber) &&
|
|
1943
|
+
!Device.isLockWifiT8520P(type, serialnumber));
|
|
1275
1944
|
}
|
|
1276
1945
|
static isLockWifiNoFinger(type) {
|
|
1277
1946
|
return types_1.DeviceType.LOCK_WIFI_NO_FINGER == type;
|
|
@@ -1298,12 +1967,18 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1298
1967
|
return types_1.DeviceType.LOCK_8502 == type;
|
|
1299
1968
|
}
|
|
1300
1969
|
static isLockWifiT8510P(type, serialnumber) {
|
|
1301
|
-
if (type == types_1.DeviceType.LOCK_WIFI &&
|
|
1970
|
+
if (type == types_1.DeviceType.LOCK_WIFI &&
|
|
1971
|
+
serialnumber.startsWith("T8520") &&
|
|
1972
|
+
serialnumber.length > 6 &&
|
|
1973
|
+
serialnumber.charAt(6) === "8")
|
|
1302
1974
|
return true;
|
|
1303
1975
|
return false;
|
|
1304
1976
|
}
|
|
1305
1977
|
static isLockWifiT8520P(type, serialnumber) {
|
|
1306
|
-
if (type == types_1.DeviceType.LOCK_WIFI &&
|
|
1978
|
+
if (type == types_1.DeviceType.LOCK_WIFI &&
|
|
1979
|
+
serialnumber.startsWith("T8520") &&
|
|
1980
|
+
serialnumber.length > 6 &&
|
|
1981
|
+
serialnumber.charAt(6) === "9")
|
|
1307
1982
|
return true;
|
|
1308
1983
|
return false;
|
|
1309
1984
|
}
|
|
@@ -1366,7 +2041,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1366
2041
|
return types_1.DeviceType.SOLO_CAMERA_E30 == type;
|
|
1367
2042
|
}
|
|
1368
2043
|
static isSoloCameras(type) {
|
|
1369
|
-
return Device.isSoloCamera(type) ||
|
|
2044
|
+
return (Device.isSoloCamera(type) ||
|
|
1370
2045
|
Device.isSoloCameraPro(type) ||
|
|
1371
2046
|
Device.isSoloCameraSpotlight1080(type) ||
|
|
1372
2047
|
Device.isSoloCameraSpotlight2k(type) ||
|
|
@@ -1374,7 +2049,8 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1374
2049
|
Device.isOutdoorPanAndTiltCamera(type) ||
|
|
1375
2050
|
Device.isSoloCameraSolar(type) ||
|
|
1376
2051
|
Device.isSoloCameraC210(type) ||
|
|
1377
|
-
Device.isSoloCameraE30(type)
|
|
2052
|
+
Device.isSoloCameraE30(type) ||
|
|
2053
|
+
Device.isCameraC35(type));
|
|
1378
2054
|
}
|
|
1379
2055
|
static isStarlight4GLTE(type) {
|
|
1380
2056
|
return types_1.DeviceType.CAMERA_FG == type;
|
|
@@ -1391,6 +2067,9 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1391
2067
|
static isIndoorCamMini(type) {
|
|
1392
2068
|
return types_1.DeviceType.INDOOR_COST_DOWN_CAMERA == type;
|
|
1393
2069
|
}
|
|
2070
|
+
static isIndoorCamC24(type) {
|
|
2071
|
+
return types_1.DeviceType.INDOOR_PT_CAMERA == type;
|
|
2072
|
+
}
|
|
1394
2073
|
static isCamera1Product(type) {
|
|
1395
2074
|
return Device.isCamera1(type) || Device.isCameraE(type);
|
|
1396
2075
|
}
|
|
@@ -1410,8 +2089,16 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1410
2089
|
//T8142
|
|
1411
2090
|
return types_1.DeviceType.CAMERA2C_PRO == type;
|
|
1412
2091
|
}
|
|
2092
|
+
static isCameraE40(type) {
|
|
2093
|
+
//T8144
|
|
2094
|
+
return types_1.DeviceType.CAMERA_E40 == type;
|
|
2095
|
+
}
|
|
1413
2096
|
static isCamera2Product(type) {
|
|
1414
|
-
return Device.isCamera2(type) ||
|
|
2097
|
+
return (Device.isCamera2(type) ||
|
|
2098
|
+
Device.isCamera2C(type) ||
|
|
2099
|
+
Device.isCamera2Pro(type) ||
|
|
2100
|
+
Device.isCamera2CPro(type) ||
|
|
2101
|
+
Device.isCameraE40(type));
|
|
1415
2102
|
}
|
|
1416
2103
|
static isCamera3(type) {
|
|
1417
2104
|
return types_1.DeviceType.CAMERA3 == type;
|
|
@@ -1427,11 +2114,14 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1427
2114
|
return types_1.DeviceType.PROFESSIONAL_247 == type;
|
|
1428
2115
|
}
|
|
1429
2116
|
static isCamera3Product(type) {
|
|
1430
|
-
return Device.isCamera3(type) ||
|
|
2117
|
+
return (Device.isCamera3(type) ||
|
|
2118
|
+
Device.isCamera3C(type) ||
|
|
2119
|
+
Device.isCameraProfessional247(type) ||
|
|
2120
|
+
Device.isCamera3Pro(type));
|
|
1431
2121
|
}
|
|
1432
2122
|
static isEntrySensor(type) {
|
|
1433
2123
|
//T8900
|
|
1434
|
-
return types_1.DeviceType.SENSOR == type;
|
|
2124
|
+
return types_1.DeviceType.SENSOR == type || this.isEntryE20(type);
|
|
1435
2125
|
}
|
|
1436
2126
|
static isMotionSensor(type) {
|
|
1437
2127
|
return types_1.DeviceType.MOTION_SENSOR == type;
|
|
@@ -1456,7 +2146,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1456
2146
|
}
|
|
1457
2147
|
static isIntegratedDeviceBySn(sn) {
|
|
1458
2148
|
//TODO: Update this implementation!
|
|
1459
|
-
return sn.startsWith("T8420") ||
|
|
2149
|
+
return (sn.startsWith("T8420") ||
|
|
1460
2150
|
sn.startsWith("T820") ||
|
|
1461
2151
|
sn.startsWith("T8410") ||
|
|
1462
2152
|
sn.startsWith("T8400") ||
|
|
@@ -1466,28 +2156,30 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1466
2156
|
sn.startsWith("T8130") ||
|
|
1467
2157
|
sn.startsWith("T8131") ||
|
|
1468
2158
|
sn.startsWith("T8171") ||
|
|
2159
|
+
sn.startsWith("T8214") ||
|
|
1469
2160
|
sn.startsWith("T8422") ||
|
|
1470
2161
|
sn.startsWith("T8423") ||
|
|
1471
2162
|
sn.startsWith("T8424") ||
|
|
2163
|
+
sn.startsWith("T8425") ||
|
|
1472
2164
|
sn.startsWith("T8426") ||
|
|
1473
2165
|
sn.startsWith("T8440") ||
|
|
1474
2166
|
sn.startsWith("T8441") ||
|
|
1475
|
-
sn.startsWith("T8442");
|
|
2167
|
+
sn.startsWith("T8442"));
|
|
1476
2168
|
}
|
|
1477
2169
|
static isSoloCameraBySn(sn) {
|
|
1478
|
-
return sn.startsWith("T8130") ||
|
|
2170
|
+
return (sn.startsWith("T8130") ||
|
|
1479
2171
|
sn.startsWith("T8131") ||
|
|
1480
2172
|
sn.startsWith("T8122") ||
|
|
1481
2173
|
sn.startsWith("T8123") ||
|
|
1482
2174
|
sn.startsWith("T8124") ||
|
|
1483
2175
|
sn.startsWith("T8171") ||
|
|
1484
|
-
sn.startsWith("T8134");
|
|
2176
|
+
sn.startsWith("T8134"));
|
|
1485
2177
|
}
|
|
1486
2178
|
static isSmartDropBySn(sn) {
|
|
1487
2179
|
return sn.startsWith("T8790");
|
|
1488
2180
|
}
|
|
1489
2181
|
static isLockBySn(sn) {
|
|
1490
|
-
return sn.startsWith("T8510") ||
|
|
2182
|
+
return (sn.startsWith("T8510") ||
|
|
1491
2183
|
sn.startsWith("T8520") ||
|
|
1492
2184
|
sn.startsWith("T8500") ||
|
|
1493
2185
|
sn.startsWith("T8501") ||
|
|
@@ -1495,40 +2187,34 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1495
2187
|
sn.startsWith("T8502") ||
|
|
1496
2188
|
sn.startsWith("T8504") ||
|
|
1497
2189
|
sn.startsWith("T8506") ||
|
|
1498
|
-
sn.startsWith("T8530");
|
|
2190
|
+
sn.startsWith("T8530"));
|
|
1499
2191
|
}
|
|
1500
2192
|
static isGarageCameraBySn(sn) {
|
|
1501
|
-
return sn.startsWith("T8453") ||
|
|
1502
|
-
sn.startsWith("T8452");
|
|
2193
|
+
return sn.startsWith("T8453") || sn.startsWith("T8452");
|
|
1503
2194
|
}
|
|
1504
2195
|
static isFloodlightBySn(sn) {
|
|
1505
|
-
return sn.startsWith("T8420") ||
|
|
2196
|
+
return (sn.startsWith("T8420") ||
|
|
1506
2197
|
sn.startsWith("T8422") ||
|
|
1507
2198
|
sn.startsWith("T8423") ||
|
|
1508
2199
|
sn.startsWith("T8424") ||
|
|
1509
|
-
sn.startsWith("T8426");
|
|
2200
|
+
sn.startsWith("T8426"));
|
|
1510
2201
|
//(sn.startsWith("T8420") && sn.length > 7 && sn[6] == "6");
|
|
1511
2202
|
}
|
|
1512
2203
|
static isIndoorCameraBySn(sn) {
|
|
1513
|
-
return sn.startsWith("T8410") ||
|
|
2204
|
+
return (sn.startsWith("T8410") ||
|
|
1514
2205
|
sn.startsWith("T8400") ||
|
|
1515
2206
|
sn.startsWith("T8401") ||
|
|
1516
2207
|
sn.startsWith("T8411") ||
|
|
1517
2208
|
sn.startsWith("T8440") ||
|
|
1518
2209
|
sn.startsWith("T8441") ||
|
|
1519
2210
|
sn.startsWith("T8442") ||
|
|
1520
|
-
sn.startsWith("T8414");
|
|
2211
|
+
sn.startsWith("T8414"));
|
|
1521
2212
|
}
|
|
1522
2213
|
static is4GCameraBySn(sn) {
|
|
1523
|
-
return sn.startsWith("T8150") ||
|
|
1524
|
-
sn.startsWith("T8151") ||
|
|
1525
|
-
sn.startsWith("T8152") ||
|
|
1526
|
-
sn.startsWith("T8153");
|
|
2214
|
+
return sn.startsWith("T8150") || sn.startsWith("T8151") || sn.startsWith("T8152") || sn.startsWith("T8153");
|
|
1527
2215
|
}
|
|
1528
2216
|
static isSmartSafeBySn(sn) {
|
|
1529
|
-
return sn.startsWith("T7400") ||
|
|
1530
|
-
sn.startsWith("T7401") ||
|
|
1531
|
-
sn.startsWith("T7402");
|
|
2217
|
+
return sn.startsWith("T7400") || sn.startsWith("T7401") || sn.startsWith("T7402");
|
|
1532
2218
|
}
|
|
1533
2219
|
static isSmartTrackCard(type) {
|
|
1534
2220
|
if (type == types_1.DeviceType.SMART_TRACK_CARD)
|
|
@@ -1541,8 +2227,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1541
2227
|
return false;
|
|
1542
2228
|
}
|
|
1543
2229
|
static isSmartTrack(type) {
|
|
1544
|
-
if (type == types_1.DeviceType.SMART_TRACK_LINK ||
|
|
1545
|
-
type == types_1.DeviceType.SMART_TRACK_CARD)
|
|
2230
|
+
if (type == types_1.DeviceType.SMART_TRACK_LINK || type == types_1.DeviceType.SMART_TRACK_CARD)
|
|
1546
2231
|
return true;
|
|
1547
2232
|
return false;
|
|
1548
2233
|
}
|
|
@@ -1687,6 +2372,9 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1687
2372
|
isIndoorCamMini() {
|
|
1688
2373
|
return Device.isIndoorCamMini(this.rawDevice.device_type);
|
|
1689
2374
|
}
|
|
2375
|
+
isIndoorCamC24() {
|
|
2376
|
+
return Device.isIndoorCamC24(this.rawDevice.device_type);
|
|
2377
|
+
}
|
|
1690
2378
|
isSoloCameras() {
|
|
1691
2379
|
return Device.isSoloCameras(this.rawDevice.device_type);
|
|
1692
2380
|
}
|
|
@@ -1754,7 +2442,12 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1754
2442
|
if (this.isLock() || this.isSmartDrop()) {
|
|
1755
2443
|
return this.rawDevice.device_sn === this.rawDevice.station_sn;
|
|
1756
2444
|
}
|
|
1757
|
-
return this.isWiredDoorbellDual() ||
|
|
2445
|
+
return (this.isWiredDoorbellDual() ||
|
|
2446
|
+
this.isFloodLight() ||
|
|
2447
|
+
this.isWiredDoorbell() ||
|
|
2448
|
+
this.isIndoorCamera() ||
|
|
2449
|
+
this.isSoloCameras() ||
|
|
2450
|
+
this.isWallLightCam());
|
|
1758
2451
|
}
|
|
1759
2452
|
isSmartTrack() {
|
|
1760
2453
|
return Device.isSmartTrack(this.rawDevice.device_type);
|
|
@@ -1847,7 +2540,12 @@ class Camera extends Device {
|
|
|
1847
2540
|
}
|
|
1848
2541
|
catch (err) {
|
|
1849
2542
|
const error = (0, error_2.ensureError)(err);
|
|
1850
|
-
logging_1.rootHTTPLogger.error("Camera convert raw property - Error", {
|
|
2543
|
+
logging_1.rootHTTPLogger.error("Camera convert raw property - Error", {
|
|
2544
|
+
error: (0, utils_3.getError)(error),
|
|
2545
|
+
deviceSN: this.getSerial(),
|
|
2546
|
+
property: property,
|
|
2547
|
+
value: value,
|
|
2548
|
+
});
|
|
1851
2549
|
}
|
|
1852
2550
|
return super.convertRawPropertyValue(property, value);
|
|
1853
2551
|
}
|
|
@@ -1860,7 +2558,7 @@ class Camera extends Device {
|
|
|
1860
2558
|
async startDetection() {
|
|
1861
2559
|
// Start camera detection.
|
|
1862
2560
|
//TODO: Deprecated. Will be removed!
|
|
1863
|
-
await this.setParameters([{ paramType: types_1.ParamType.DETECT_SWITCH, paramValue: 1 }]).catch(err => {
|
|
2561
|
+
await this.setParameters([{ paramType: types_1.ParamType.DETECT_SWITCH, paramValue: 1 }]).catch((err) => {
|
|
1864
2562
|
const error = (0, error_2.ensureError)(err);
|
|
1865
2563
|
logging_1.rootHTTPLogger.error("Camera start detection - Error", { error: (0, utils_3.getError)(error), deviceSN: this.getSerial() });
|
|
1866
2564
|
});
|
|
@@ -1981,7 +2679,12 @@ class Camera extends Device {
|
|
|
1981
2679
|
}
|
|
1982
2680
|
catch (err) {
|
|
1983
2681
|
const error = (0, error_2.ensureError)(err);
|
|
1984
|
-
logging_1.rootHTTPLogger.debug(`Camera process push notification - CusPushEvent.SECURITY - Error`, {
|
|
2682
|
+
logging_1.rootHTTPLogger.debug(`Camera process push notification - CusPushEvent.SECURITY - Error`, {
|
|
2683
|
+
error: (0, utils_3.getError)(error),
|
|
2684
|
+
deviceSN: this.getSerial(),
|
|
2685
|
+
message: JSON.stringify(message),
|
|
2686
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
2687
|
+
});
|
|
1985
2688
|
}
|
|
1986
2689
|
}
|
|
1987
2690
|
else if (message.msg_type === types_1.DeviceType.HB3) {
|
|
@@ -2150,7 +2853,12 @@ class Camera extends Device {
|
|
|
2150
2853
|
}
|
|
2151
2854
|
catch (err) {
|
|
2152
2855
|
const error = (0, error_2.ensureError)(err);
|
|
2153
|
-
logging_1.rootHTTPLogger.debug(`Camera process push notification - HB3PairedDevicePushEvent - Error`, {
|
|
2856
|
+
logging_1.rootHTTPLogger.debug(`Camera process push notification - HB3PairedDevicePushEvent - Error`, {
|
|
2857
|
+
error: (0, utils_3.getError)(error),
|
|
2858
|
+
deviceSN: this.getSerial(),
|
|
2859
|
+
message: JSON.stringify(message),
|
|
2860
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
2861
|
+
});
|
|
2154
2862
|
}
|
|
2155
2863
|
}
|
|
2156
2864
|
}
|
|
@@ -2177,7 +2885,12 @@ class SoloCamera extends Camera {
|
|
|
2177
2885
|
}
|
|
2178
2886
|
catch (err) {
|
|
2179
2887
|
const error = (0, error_2.ensureError)(err);
|
|
2180
|
-
logging_1.rootHTTPLogger.error("SoloCamera convert raw property - Error", {
|
|
2888
|
+
logging_1.rootHTTPLogger.error("SoloCamera convert raw property - Error", {
|
|
2889
|
+
error: (0, utils_3.getError)(error),
|
|
2890
|
+
deviceSN: this.getSerial(),
|
|
2891
|
+
property: property,
|
|
2892
|
+
value: value,
|
|
2893
|
+
});
|
|
2181
2894
|
}
|
|
2182
2895
|
return super.convertRawPropertyValue(property, value);
|
|
2183
2896
|
}
|
|
@@ -2221,7 +2934,12 @@ class SoloCamera extends Camera {
|
|
|
2221
2934
|
}
|
|
2222
2935
|
catch (err) {
|
|
2223
2936
|
const error = (0, error_2.ensureError)(err);
|
|
2224
|
-
logging_1.rootHTTPLogger.debug(`SoloCamera process push notification - Error`, {
|
|
2937
|
+
logging_1.rootHTTPLogger.debug(`SoloCamera process push notification - Error`, {
|
|
2938
|
+
error: (0, utils_3.getError)(error),
|
|
2939
|
+
deviceSN: this.getSerial(),
|
|
2940
|
+
message: JSON.stringify(message),
|
|
2941
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
2942
|
+
});
|
|
2225
2943
|
}
|
|
2226
2944
|
}
|
|
2227
2945
|
}
|
|
@@ -2337,7 +3055,12 @@ class IndoorCamera extends Camera {
|
|
|
2337
3055
|
}
|
|
2338
3056
|
catch (err) {
|
|
2339
3057
|
const error = (0, error_2.ensureError)(err);
|
|
2340
|
-
logging_1.rootHTTPLogger.debug(`IndoorCamera process push notification - Error`, {
|
|
3058
|
+
logging_1.rootHTTPLogger.debug(`IndoorCamera process push notification - Error`, {
|
|
3059
|
+
error: (0, utils_3.getError)(error),
|
|
3060
|
+
deviceSN: this.getSerial(),
|
|
3061
|
+
message: JSON.stringify(message),
|
|
3062
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
3063
|
+
});
|
|
2341
3064
|
}
|
|
2342
3065
|
}
|
|
2343
3066
|
}
|
|
@@ -2530,7 +3253,12 @@ class DoorbellCamera extends Camera {
|
|
|
2530
3253
|
}
|
|
2531
3254
|
catch (err) {
|
|
2532
3255
|
const error = (0, error_2.ensureError)(err);
|
|
2533
|
-
logging_1.rootHTTPLogger.debug(`DoorbellCamera process push notification - Error`, {
|
|
3256
|
+
logging_1.rootHTTPLogger.debug(`DoorbellCamera process push notification - Error`, {
|
|
3257
|
+
error: (0, utils_3.getError)(error),
|
|
3258
|
+
deviceSN: this.getSerial(),
|
|
3259
|
+
message: JSON.stringify(message),
|
|
3260
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
3261
|
+
});
|
|
2534
3262
|
}
|
|
2535
3263
|
}
|
|
2536
3264
|
}
|
|
@@ -2577,7 +3305,9 @@ class FloodlightCamera extends Camera {
|
|
|
2577
3305
|
try {
|
|
2578
3306
|
switch (property.key) {
|
|
2579
3307
|
case types_2.CommandType.CMD_DEV_RECORD_AUTOSTOP:
|
|
2580
|
-
if (this.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 ||
|
|
3308
|
+
if (this.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 ||
|
|
3309
|
+
this.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8424 ||
|
|
3310
|
+
this.getDeviceType() === types_1.DeviceType.FLOODLIGHT)
|
|
2581
3311
|
return value !== undefined ? (value === "0" ? true : false) : false;
|
|
2582
3312
|
break;
|
|
2583
3313
|
case types_2.CommandType.CMD_FLOODLIGHT_SET_AUTO_CALIBRATION:
|
|
@@ -2609,7 +3339,12 @@ class FloodlightCamera extends Camera {
|
|
|
2609
3339
|
}
|
|
2610
3340
|
catch (err) {
|
|
2611
3341
|
const error = (0, error_2.ensureError)(err);
|
|
2612
|
-
logging_1.rootHTTPLogger.error("FloodlightCamera convert raw property - Error", {
|
|
3342
|
+
logging_1.rootHTTPLogger.error("FloodlightCamera convert raw property - Error", {
|
|
3343
|
+
error: (0, utils_3.getError)(error),
|
|
3344
|
+
deviceSN: this.getSerial(),
|
|
3345
|
+
property: property,
|
|
3346
|
+
value: value,
|
|
3347
|
+
});
|
|
2613
3348
|
}
|
|
2614
3349
|
return super.convertRawPropertyValue(property, value);
|
|
2615
3350
|
}
|
|
@@ -2653,7 +3388,12 @@ class FloodlightCamera extends Camera {
|
|
|
2653
3388
|
}
|
|
2654
3389
|
catch (err) {
|
|
2655
3390
|
const error = (0, error_2.ensureError)(err);
|
|
2656
|
-
logging_1.rootHTTPLogger.debug(`FloodlightCamera process push notification - Error`, {
|
|
3391
|
+
logging_1.rootHTTPLogger.debug(`FloodlightCamera process push notification - Error`, {
|
|
3392
|
+
error: (0, utils_3.getError)(error),
|
|
3393
|
+
deviceSN: this.getSerial(),
|
|
3394
|
+
message: JSON.stringify(message),
|
|
3395
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
3396
|
+
});
|
|
2657
3397
|
}
|
|
2658
3398
|
}
|
|
2659
3399
|
}
|
|
@@ -2679,16 +3419,19 @@ class WallLightCam extends Camera {
|
|
|
2679
3419
|
return value !== undefined ? (value === "1" ? true : false) : false;
|
|
2680
3420
|
case types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MANUAL_COLORED_LIGHTING:
|
|
2681
3421
|
case types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MOTION_COLORED_LIGHTING:
|
|
2682
|
-
case types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_SCHEDULE_COLORED_LIGHTING:
|
|
2683
|
-
{
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
3422
|
+
case types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_SCHEDULE_COLORED_LIGHTING: {
|
|
3423
|
+
const defaultColor = {
|
|
3424
|
+
red: 0,
|
|
3425
|
+
green: 0,
|
|
3426
|
+
blue: 0,
|
|
3427
|
+
};
|
|
3428
|
+
const internal = value;
|
|
3429
|
+
return internal !== undefined
|
|
3430
|
+
? internal.rgb_color !== undefined
|
|
3431
|
+
? (0, utils_2.DecimalToRGBColor)(internal.rgb_color)
|
|
3432
|
+
: defaultColor
|
|
3433
|
+
: defaultColor;
|
|
3434
|
+
}
|
|
2692
3435
|
case types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_COLORED_LIGHTING_COLORS: {
|
|
2693
3436
|
const result = [];
|
|
2694
3437
|
for (const color of value) {
|
|
@@ -2703,7 +3446,7 @@ class WallLightCam extends Camera {
|
|
|
2703
3446
|
colors: theme.colors.map((color) => (0, utils_2.DecimalToRGBColor)(color)),
|
|
2704
3447
|
mode: theme.mode,
|
|
2705
3448
|
name: theme.name, // 1 fade 2 blink
|
|
2706
|
-
speed: theme.speed // Control speed 500 msec to 5 sec.; 500 msec steps
|
|
3449
|
+
speed: theme.speed, // Control speed 500 msec to 5 sec.; 500 msec steps
|
|
2707
3450
|
});
|
|
2708
3451
|
}
|
|
2709
3452
|
return result;
|
|
@@ -2712,7 +3455,12 @@ class WallLightCam extends Camera {
|
|
|
2712
3455
|
}
|
|
2713
3456
|
catch (err) {
|
|
2714
3457
|
const error = (0, error_2.ensureError)(err);
|
|
2715
|
-
logging_1.rootHTTPLogger.error("WallLightCam convert raw property - Error", {
|
|
3458
|
+
logging_1.rootHTTPLogger.error("WallLightCam convert raw property - Error", {
|
|
3459
|
+
error: (0, utils_3.getError)(error),
|
|
3460
|
+
deviceSN: this.getSerial(),
|
|
3461
|
+
property: property,
|
|
3462
|
+
value: value,
|
|
3463
|
+
});
|
|
2716
3464
|
}
|
|
2717
3465
|
return super.convertRawPropertyValue(property, value);
|
|
2718
3466
|
}
|
|
@@ -2770,7 +3518,12 @@ class WallLightCam extends Camera {
|
|
|
2770
3518
|
}
|
|
2771
3519
|
catch (err) {
|
|
2772
3520
|
const error = (0, error_2.ensureError)(err);
|
|
2773
|
-
logging_1.rootHTTPLogger.debug(`WallLightCam process push notification - Error`, {
|
|
3521
|
+
logging_1.rootHTTPLogger.debug(`WallLightCam process push notification - Error`, {
|
|
3522
|
+
error: (0, utils_3.getError)(error),
|
|
3523
|
+
deviceSN: this.getSerial(),
|
|
3524
|
+
message: JSON.stringify(message),
|
|
3525
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
3526
|
+
});
|
|
2774
3527
|
}
|
|
2775
3528
|
}
|
|
2776
3529
|
}
|
|
@@ -2845,13 +3598,25 @@ class GarageCamera extends Camera {
|
|
|
2845
3598
|
return sensorsData?.data?.door_2?.version !== undefined ? sensorsData?.data?.door_2?.version : "";
|
|
2846
3599
|
}
|
|
2847
3600
|
else if (property.name === types_1.PropertyName.DeviceDoorControlWarning) {
|
|
2848
|
-
return sensorsData?.data?.door_1?.playalarm !== undefined
|
|
3601
|
+
return sensorsData?.data?.door_1?.playalarm !== undefined
|
|
3602
|
+
? sensorsData?.data?.door_1?.playalarm === 1
|
|
3603
|
+
? true
|
|
3604
|
+
: false
|
|
3605
|
+
: false;
|
|
2849
3606
|
}
|
|
2850
3607
|
else if (property.name === types_1.PropertyName.DeviceDoorSensor1Status) {
|
|
2851
|
-
return sensorsData?.data?.door_1?.power !== undefined
|
|
3608
|
+
return sensorsData?.data?.door_1?.power !== undefined
|
|
3609
|
+
? sensorsData?.data?.door_1?.power >= 1 && sensorsData?.data?.door_1?.sn !== ""
|
|
3610
|
+
? 1
|
|
3611
|
+
: 0
|
|
3612
|
+
: 0;
|
|
2852
3613
|
}
|
|
2853
3614
|
else if (property.name === types_1.PropertyName.DeviceDoorSensor2Status) {
|
|
2854
|
-
return sensorsData?.data?.door_2?.power !== undefined
|
|
3615
|
+
return sensorsData?.data?.door_2?.power !== undefined
|
|
3616
|
+
? sensorsData?.data?.door_2?.power >= 1 && sensorsData?.data?.door_2?.sn !== ""
|
|
3617
|
+
? 1
|
|
3618
|
+
: 0
|
|
3619
|
+
: 0;
|
|
2855
3620
|
}
|
|
2856
3621
|
}
|
|
2857
3622
|
break;
|
|
@@ -2859,7 +3624,12 @@ class GarageCamera extends Camera {
|
|
|
2859
3624
|
}
|
|
2860
3625
|
catch (err) {
|
|
2861
3626
|
const error = (0, error_2.ensureError)(err);
|
|
2862
|
-
logging_1.rootHTTPLogger.error("GarageCamera convert raw property - Error", {
|
|
3627
|
+
logging_1.rootHTTPLogger.error("GarageCamera convert raw property - Error", {
|
|
3628
|
+
error: (0, utils_3.getError)(error),
|
|
3629
|
+
deviceSN: this.getSerial(),
|
|
3630
|
+
property: property,
|
|
3631
|
+
value: value,
|
|
3632
|
+
});
|
|
2863
3633
|
}
|
|
2864
3634
|
return super.convertRawPropertyValue(property, value);
|
|
2865
3635
|
}
|
|
@@ -2907,7 +3677,12 @@ class GarageCamera extends Camera {
|
|
|
2907
3677
|
}
|
|
2908
3678
|
catch (err) {
|
|
2909
3679
|
const error = (0, error_2.ensureError)(err);
|
|
2910
|
-
logging_1.rootHTTPLogger.debug(`GarageCamera process push notification - Error`, {
|
|
3680
|
+
logging_1.rootHTTPLogger.debug(`GarageCamera process push notification - Error`, {
|
|
3681
|
+
error: (0, utils_3.getError)(error),
|
|
3682
|
+
deviceSN: this.getSerial(),
|
|
3683
|
+
message: JSON.stringify(message),
|
|
3684
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
3685
|
+
});
|
|
2911
3686
|
}
|
|
2912
3687
|
}
|
|
2913
3688
|
}
|
|
@@ -2950,7 +3725,12 @@ class EntrySensor extends Sensor {
|
|
|
2950
3725
|
}
|
|
2951
3726
|
catch (err) {
|
|
2952
3727
|
const error = (0, error_2.ensureError)(err);
|
|
2953
|
-
logging_1.rootHTTPLogger.debug(`EntrySensor process push notification - Error`, {
|
|
3728
|
+
logging_1.rootHTTPLogger.debug(`EntrySensor process push notification - Error`, {
|
|
3729
|
+
error: (0, utils_3.getError)(error),
|
|
3730
|
+
deviceSN: this.getSerial(),
|
|
3731
|
+
message: JSON.stringify(message),
|
|
3732
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
3733
|
+
});
|
|
2954
3734
|
}
|
|
2955
3735
|
}
|
|
2956
3736
|
}
|
|
@@ -2972,16 +3752,16 @@ class MotionSensor extends Sensor {
|
|
|
2972
3752
|
//TODO: CMD_MOTION_SENSOR_SET_PIR_SENSITIVITY = 1609
|
|
2973
3753
|
//TODO: CMD_MOTION_SENSOR_WORK_MODE = 1612
|
|
2974
3754
|
/*public static isMotionDetected(millis: number): { motion: boolean, cooldown_ms: number} {
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
3755
|
+
const delta = new Date().getUTCMilliseconds() - millis;
|
|
3756
|
+
if (delta < this.MOTION_COOLDOWN_MS) {
|
|
3757
|
+
return { motion: true, cooldown_ms: this.MOTION_COOLDOWN_MS - delta};
|
|
3758
|
+
}
|
|
3759
|
+
return { motion: false, cooldown_ms: 0};
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
public isMotionDetected(): { motion: boolean, cooldown_ms: number} {
|
|
3763
|
+
return MotionSensor.isMotionDetected(this.getMotionSensorPIREvent());
|
|
3764
|
+
}*/
|
|
2985
3765
|
constructor(api, device, deviceConfig) {
|
|
2986
3766
|
super(api, device, deviceConfig);
|
|
2987
3767
|
this.properties[types_1.PropertyName.DeviceMotionDetected] = false;
|
|
@@ -3019,7 +3799,12 @@ class MotionSensor extends Sensor {
|
|
|
3019
3799
|
}
|
|
3020
3800
|
catch (err) {
|
|
3021
3801
|
const error = (0, error_2.ensureError)(err);
|
|
3022
|
-
logging_1.rootHTTPLogger.debug(`MotionSensor process push notification - Error`, {
|
|
3802
|
+
logging_1.rootHTTPLogger.debug(`MotionSensor process push notification - Error`, {
|
|
3803
|
+
error: (0, utils_3.getError)(error),
|
|
3804
|
+
deviceSN: this.getSerial(),
|
|
3805
|
+
message: JSON.stringify(message),
|
|
3806
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
3807
|
+
});
|
|
3023
3808
|
}
|
|
3024
3809
|
}
|
|
3025
3810
|
}
|
|
@@ -3043,7 +3828,10 @@ class Lock extends Device {
|
|
|
3043
3828
|
else if (metadata.name === types_1.PropertyName.DeviceLowBatteryAlert) {
|
|
3044
3829
|
this.emit("low battery", this, newValue);
|
|
3045
3830
|
}
|
|
3046
|
-
else if ((metadata.key === types_2.CommandType.CMD_DOORLOCK_GET_STATE ||
|
|
3831
|
+
else if ((metadata.key === types_2.CommandType.CMD_DOORLOCK_GET_STATE ||
|
|
3832
|
+
metadata.key === types_2.CommandType.CMD_SMARTLOCK_QUERY_STATUS) &&
|
|
3833
|
+
((oldValue !== undefined && ((oldValue === 4 && newValue !== 4) || (oldValue !== 4 && newValue === 4))) ||
|
|
3834
|
+
oldValue === undefined)) {
|
|
3047
3835
|
this.updateProperty(types_1.PropertyName.DeviceLocked, newValue === 4 ? true : false);
|
|
3048
3836
|
}
|
|
3049
3837
|
}
|
|
@@ -3092,7 +3880,9 @@ class Lock extends Device {
|
|
|
3092
3880
|
processMQTTNotification(message, eventDurationSeconds) {
|
|
3093
3881
|
if (message.eventType === types_3.LockPushEvent.STATUS_CHANGE) {
|
|
3094
3882
|
// Lock state event
|
|
3095
|
-
const cmdType = this.isLockBle() || this.isLockBleNoFinger()
|
|
3883
|
+
const cmdType = this.isLockBle() || this.isLockBleNoFinger()
|
|
3884
|
+
? types_2.CommandType.CMD_DOORLOCK_GET_STATE
|
|
3885
|
+
: types_2.CommandType.CMD_SMARTLOCK_QUERY_STATUS;
|
|
3096
3886
|
this.updateRawProperty(cmdType, message.lockState, "mqtt");
|
|
3097
3887
|
}
|
|
3098
3888
|
else if (message.eventType === types_3.LockPushEvent.OTA_STATUS) {
|
|
@@ -3112,52 +3902,55 @@ class Lock extends Device {
|
|
|
3112
3902
|
case types_3.LockPushEvent.KEYPAD_LOCK:
|
|
3113
3903
|
case types_3.LockPushEvent.MANUAL_LOCK:
|
|
3114
3904
|
case types_3.LockPushEvent.PW_LOCK:
|
|
3115
|
-
case types_3.LockPushEvent.TEMPORARY_PW_LOCK:
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
}
|
|
3129
|
-
break;
|
|
3905
|
+
case types_3.LockPushEvent.TEMPORARY_PW_LOCK: {
|
|
3906
|
+
const cmdType = this.isLockBle() || this.isLockBleNoFinger()
|
|
3907
|
+
? types_2.CommandType.CMD_DOORLOCK_GET_STATE
|
|
3908
|
+
: types_2.CommandType.CMD_SMARTLOCK_QUERY_STATUS;
|
|
3909
|
+
this.updateRawProperty(cmdType, "4", source);
|
|
3910
|
+
if (!(0, utils_3.isEmpty)(personName)) {
|
|
3911
|
+
this.updateProperty(types_1.PropertyName.DevicePersonName, personName);
|
|
3912
|
+
this.updateProperty(types_1.PropertyName.DeviceLockEventOrigin, (0, utils_1.getLockEventType)(eventType));
|
|
3913
|
+
this.clearEventTimeout(types_1.DeviceEvent.Lock);
|
|
3914
|
+
this.eventTimeouts.set(types_1.DeviceEvent.Lock, setTimeout(async () => {
|
|
3915
|
+
this.updateProperty(types_1.PropertyName.DevicePersonName, "");
|
|
3916
|
+
this.updateProperty(types_1.PropertyName.DeviceLockEventOrigin, 0);
|
|
3917
|
+
this.eventTimeouts.delete(types_1.DeviceEvent.Lock);
|
|
3918
|
+
}, eventDurationSeconds * 1000));
|
|
3130
3919
|
}
|
|
3920
|
+
break;
|
|
3921
|
+
}
|
|
3131
3922
|
case types_3.LockPushEvent.APP_UNLOCK:
|
|
3132
3923
|
case types_3.LockPushEvent.AUTO_UNLOCK:
|
|
3133
3924
|
case types_3.LockPushEvent.FINGERPRINT_UNLOCK:
|
|
3134
3925
|
case types_3.LockPushEvent.MANUAL_UNLOCK:
|
|
3135
3926
|
case types_3.LockPushEvent.PW_UNLOCK:
|
|
3136
|
-
case types_3.LockPushEvent.TEMPORARY_PW_UNLOCK:
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
}
|
|
3150
|
-
break;
|
|
3927
|
+
case types_3.LockPushEvent.TEMPORARY_PW_UNLOCK: {
|
|
3928
|
+
const cmdType = this.isLockBle() || this.isLockBleNoFinger()
|
|
3929
|
+
? types_2.CommandType.CMD_DOORLOCK_GET_STATE
|
|
3930
|
+
: types_2.CommandType.CMD_SMARTLOCK_QUERY_STATUS;
|
|
3931
|
+
this.updateRawProperty(cmdType, "3", source);
|
|
3932
|
+
if (!(0, utils_3.isEmpty)(personName)) {
|
|
3933
|
+
this.updateProperty(types_1.PropertyName.DevicePersonName, personName);
|
|
3934
|
+
this.updateProperty(types_1.PropertyName.DeviceLockEventOrigin, (0, utils_1.getLockEventType)(eventType));
|
|
3935
|
+
this.clearEventTimeout(types_1.DeviceEvent.Lock);
|
|
3936
|
+
this.eventTimeouts.set(types_1.DeviceEvent.Lock, setTimeout(async () => {
|
|
3937
|
+
this.updateProperty(types_1.PropertyName.DevicePersonName, "");
|
|
3938
|
+
this.updateProperty(types_1.PropertyName.DeviceLockEventOrigin, 0);
|
|
3939
|
+
this.eventTimeouts.delete(types_1.DeviceEvent.Lock);
|
|
3940
|
+
}, eventDurationSeconds * 1000));
|
|
3151
3941
|
}
|
|
3942
|
+
break;
|
|
3943
|
+
}
|
|
3152
3944
|
case types_3.LockPushEvent.LOCK_MECHANICAL_ANOMALY:
|
|
3153
3945
|
case types_3.LockPushEvent.MECHANICAL_ANOMALY:
|
|
3154
3946
|
case types_3.LockPushEvent.VIOLENT_DESTRUCTION:
|
|
3155
|
-
case types_3.LockPushEvent.MULTIPLE_ERRORS:
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3947
|
+
case types_3.LockPushEvent.MULTIPLE_ERRORS: {
|
|
3948
|
+
const cmdType = this.isLockBle() || this.isLockBleNoFinger()
|
|
3949
|
+
? types_2.CommandType.CMD_DOORLOCK_GET_STATE
|
|
3950
|
+
: types_2.CommandType.CMD_SMARTLOCK_QUERY_STATUS;
|
|
3951
|
+
this.updateRawProperty(cmdType, "5", source);
|
|
3952
|
+
break;
|
|
3953
|
+
}
|
|
3161
3954
|
case types_3.LockPushEvent.LOW_POWER:
|
|
3162
3955
|
case types_3.LockPushEvent.VERY_LOW_POWER:
|
|
3163
3956
|
this.updateProperty(types_1.PropertyName.DeviceLowBatteryAlert, true);
|
|
@@ -3180,27 +3973,34 @@ class Lock extends Device {
|
|
|
3180
3973
|
}
|
|
3181
3974
|
catch (err) {
|
|
3182
3975
|
const error = (0, error_2.ensureError)(err);
|
|
3183
|
-
logging_1.rootHTTPLogger.debug(`Lock process push notification - Error`, {
|
|
3976
|
+
logging_1.rootHTTPLogger.debug(`Lock process push notification - Error`, {
|
|
3977
|
+
error: (0, utils_3.getError)(error),
|
|
3978
|
+
deviceSN: this.getSerial(),
|
|
3979
|
+
eventType: eventType,
|
|
3980
|
+
eventTime: eventTime,
|
|
3981
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
3982
|
+
source: source,
|
|
3983
|
+
});
|
|
3184
3984
|
}
|
|
3185
3985
|
}
|
|
3186
3986
|
}
|
|
3187
3987
|
/*public static decodeCommand(command: number): void {
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3988
|
+
switch (command) {
|
|
3989
|
+
case ESLCommand.ON_OFF_LOCK:
|
|
3990
|
+
case 8:
|
|
3991
|
+
break;
|
|
3992
|
+
|
|
3993
|
+
case ESLCommand.QUERY_STATUS_IN_LOCK:
|
|
3994
|
+
case 17:
|
|
3995
|
+
break;
|
|
3996
|
+
|
|
3997
|
+
case ESLCommand.NOTIFY:
|
|
3998
|
+
case 18:
|
|
3999
|
+
break;
|
|
4000
|
+
default:
|
|
4001
|
+
break;
|
|
4002
|
+
}
|
|
4003
|
+
}*/
|
|
3204
4004
|
static getCurrentTimeInSeconds() {
|
|
3205
4005
|
const buffer = Buffer.allocUnsafe(4);
|
|
3206
4006
|
buffer.writeUint32LE((0, utils_2.getCurrentTimeInSeconds)());
|
|
@@ -3239,6 +4039,7 @@ class Lock extends Device {
|
|
|
3239
4039
|
return this.encodeCmdStatus(user_id);
|
|
3240
4040
|
}
|
|
3241
4041
|
static encodeCmdAddUser(short_user_id, passcode, username, schedule, user_permission = 4) {
|
|
4042
|
+
// or user_permission 1?
|
|
3242
4043
|
const payload = new utils_1.WritePayload();
|
|
3243
4044
|
payload.write(Buffer.from(short_user_id, "hex"));
|
|
3244
4045
|
payload.write(Buffer.from(passcode, "hex"));
|
|
@@ -3376,20 +4177,31 @@ class Lock extends Device {
|
|
|
3376
4177
|
switch (property.key) {
|
|
3377
4178
|
case types_2.CommandType.CMD_DOORLOCK_SET_PUSH_MODE:
|
|
3378
4179
|
if (property.name === types_1.PropertyName.DeviceNotification) {
|
|
3379
|
-
return value !== undefined
|
|
4180
|
+
return value !== undefined
|
|
4181
|
+
? (0, utils_1.isSmartLockNotification)(Number.parseInt(value), 1 /* SmartLockNotification.ENABLED */)
|
|
4182
|
+
: false;
|
|
3380
4183
|
}
|
|
3381
4184
|
else if (property.name === types_1.PropertyName.DeviceNotificationLocked) {
|
|
3382
|
-
return value !== undefined
|
|
4185
|
+
return value !== undefined
|
|
4186
|
+
? (0, utils_1.isSmartLockNotification)(Number.parseInt(value), 4 /* SmartLockNotification.LOCKED */)
|
|
4187
|
+
: false;
|
|
3383
4188
|
}
|
|
3384
4189
|
else if (property.name === types_1.PropertyName.DeviceNotificationUnlocked) {
|
|
3385
|
-
return value !== undefined
|
|
4190
|
+
return value !== undefined
|
|
4191
|
+
? (0, utils_1.isSmartLockNotification)(Number.parseInt(value), 2 /* SmartLockNotification.UNLOCKED */)
|
|
4192
|
+
: false;
|
|
3386
4193
|
}
|
|
3387
4194
|
break;
|
|
3388
4195
|
}
|
|
3389
4196
|
}
|
|
3390
4197
|
catch (err) {
|
|
3391
4198
|
const error = (0, error_2.ensureError)(err);
|
|
3392
|
-
logging_1.rootHTTPLogger.error("WallLightCam convert raw property - Error", {
|
|
4199
|
+
logging_1.rootHTTPLogger.error("WallLightCam convert raw property - Error", {
|
|
4200
|
+
error: (0, utils_3.getError)(error),
|
|
4201
|
+
deviceSN: this.getSerial(),
|
|
4202
|
+
property: property,
|
|
4203
|
+
value: value,
|
|
4204
|
+
});
|
|
3393
4205
|
}
|
|
3394
4206
|
return super.convertRawPropertyValue(property, value);
|
|
3395
4207
|
}
|
|
@@ -3461,6 +4273,7 @@ class Lock extends Device {
|
|
|
3461
4273
|
return payload.getData();
|
|
3462
4274
|
}
|
|
3463
4275
|
static encodeCmdSmartLockAddUser(adminUserId, shortUserId, passcode, username, schedule, userPermission = 4) {
|
|
4276
|
+
// or user_permission 1?
|
|
3464
4277
|
const payload = new utils_1.WritePayload();
|
|
3465
4278
|
payload.write(this.getCurrentTimeInSeconds());
|
|
3466
4279
|
payload.write(Buffer.from(adminUserId));
|
|
@@ -3565,7 +4378,12 @@ class Keypad extends Device {
|
|
|
3565
4378
|
}
|
|
3566
4379
|
catch (err) {
|
|
3567
4380
|
const error = (0, error_2.ensureError)(err);
|
|
3568
|
-
logging_1.rootHTTPLogger.error("Keypad convert raw property - Error", {
|
|
4381
|
+
logging_1.rootHTTPLogger.error("Keypad convert raw property - Error", {
|
|
4382
|
+
error: (0, utils_3.getError)(error),
|
|
4383
|
+
deviceSN: this.getSerial(),
|
|
4384
|
+
property: property,
|
|
4385
|
+
value: value,
|
|
4386
|
+
});
|
|
3569
4387
|
}
|
|
3570
4388
|
return super.convertRawPropertyValue(property, value);
|
|
3571
4389
|
}
|
|
@@ -3595,7 +4413,7 @@ class SmartSafe extends Device {
|
|
|
3595
4413
|
const timeInSeconds = (0, utils_2.getCurrentTimeInSeconds)();
|
|
3596
4414
|
const arr = new Uint8Array(4);
|
|
3597
4415
|
for (let i = 0; i < 4; i++) {
|
|
3598
|
-
arr[i] = (
|
|
4416
|
+
arr[i] = (timeInSeconds >> (i * 8)) & 255;
|
|
3599
4417
|
}
|
|
3600
4418
|
return Buffer.from(arr);
|
|
3601
4419
|
}
|
|
@@ -3697,26 +4515,45 @@ class SmartSafe extends Device {
|
|
|
3697
4515
|
try {
|
|
3698
4516
|
if (property.key === types_2.CommandType.CMD_SMARTSAFE_REMOTE_OPEN_TYPE) {
|
|
3699
4517
|
switch (property.name) {
|
|
3700
|
-
case types_1.PropertyName.DeviceRemoteUnlock:
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
4518
|
+
case types_1.PropertyName.DeviceRemoteUnlock: {
|
|
4519
|
+
const booleanProperty = property;
|
|
4520
|
+
return value !== undefined
|
|
4521
|
+
? value === "0" || value === "1"
|
|
4522
|
+
? true
|
|
4523
|
+
: false
|
|
4524
|
+
: booleanProperty.default !== undefined
|
|
4525
|
+
? booleanProperty.default
|
|
4526
|
+
: false;
|
|
4527
|
+
}
|
|
4528
|
+
case types_1.PropertyName.DeviceRemoteUnlockMasterPIN: {
|
|
4529
|
+
const booleanProperty = property;
|
|
4530
|
+
return value !== undefined
|
|
4531
|
+
? value === "0"
|
|
4532
|
+
? true
|
|
4533
|
+
: false
|
|
4534
|
+
: booleanProperty.default !== undefined
|
|
4535
|
+
? booleanProperty.default
|
|
4536
|
+
: false;
|
|
4537
|
+
}
|
|
3710
4538
|
}
|
|
3711
4539
|
}
|
|
3712
4540
|
else if (property.key === types_2.CommandType.CMD_SMARTSAFE_NOTIF) {
|
|
3713
4541
|
const booleanProperty = property;
|
|
3714
|
-
return value !== undefined
|
|
4542
|
+
return value !== undefined
|
|
4543
|
+
? ((Number.parseInt(value) >> SmartSafe.PUSH_NOTIFICATION_POSITION[property.name]) & 1) === 1
|
|
4544
|
+
: booleanProperty.default !== undefined
|
|
4545
|
+
? booleanProperty.default
|
|
4546
|
+
: false;
|
|
3715
4547
|
}
|
|
3716
4548
|
}
|
|
3717
4549
|
catch (err) {
|
|
3718
4550
|
const error = (0, error_2.ensureError)(err);
|
|
3719
|
-
logging_1.rootHTTPLogger.error("SmartSafe convert raw property - Error", {
|
|
4551
|
+
logging_1.rootHTTPLogger.error("SmartSafe convert raw property - Error", {
|
|
4552
|
+
error: (0, utils_3.getError)(error),
|
|
4553
|
+
deviceSN: this.getSerial(),
|
|
4554
|
+
property: property,
|
|
4555
|
+
value: value,
|
|
4556
|
+
});
|
|
3720
4557
|
}
|
|
3721
4558
|
return super.convertRawPropertyValue(property, value);
|
|
3722
4559
|
}
|
|
@@ -3769,66 +4606,60 @@ class SmartSafe extends Device {
|
|
|
3769
4606
|
try {
|
|
3770
4607
|
switch (message.event_type) {
|
|
3771
4608
|
//TODO: Finish smart safe push notification handling implementation
|
|
3772
|
-
case types_3.SmartSafeEvent.LOCK_STATUS:
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
*/
|
|
3785
|
-
}
|
|
3786
|
-
else if (eventValues.action === 1) {
|
|
3787
|
-
this.updateRawProperty(types_2.CommandType.CMD_SMARTSAFE_LOCK_STATUS, "1", "push");
|
|
3788
|
-
}
|
|
3789
|
-
else if (eventValues.action === 2) {
|
|
3790
|
-
this.jammedEvent(eventDurationSeconds);
|
|
3791
|
-
}
|
|
3792
|
-
else if (eventValues.action === 3) {
|
|
3793
|
-
this.lowBatteryEvent(eventDurationSeconds);
|
|
3794
|
-
}
|
|
3795
|
-
break;
|
|
3796
|
-
}
|
|
3797
|
-
case types_3.SmartSafeEvent.ALARM_911:
|
|
3798
|
-
{
|
|
3799
|
-
const eventValue = message.event_value;
|
|
3800
|
-
this.alarm911Event(eventValue, eventDurationSeconds);
|
|
3801
|
-
break;
|
|
4609
|
+
case types_3.SmartSafeEvent.LOCK_STATUS: {
|
|
4610
|
+
const eventValues = message.event_value;
|
|
4611
|
+
if (eventValues.action === 0) {
|
|
4612
|
+
this.updateRawProperty(types_2.CommandType.CMD_SMARTSAFE_LOCK_STATUS, "0", "push");
|
|
4613
|
+
/*
|
|
4614
|
+
type values:
|
|
4615
|
+
1: Unlocked by PIN
|
|
4616
|
+
2: Unlocked by User
|
|
4617
|
+
3: Unlocked by key
|
|
4618
|
+
4: Unlocked by App
|
|
4619
|
+
5: Unlocked by Dual Unlock
|
|
4620
|
+
*/
|
|
3802
4621
|
}
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
const eventValue = message.event_value;
|
|
3806
|
-
this.shakeEvent(eventValue, eventDurationSeconds);
|
|
3807
|
-
break;
|
|
4622
|
+
else if (eventValues.action === 1) {
|
|
4623
|
+
this.updateRawProperty(types_2.CommandType.CMD_SMARTSAFE_LOCK_STATUS, "1", "push");
|
|
3808
4624
|
}
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
const eventValue = message.event_value;
|
|
3812
|
-
if (eventValue === 1) {
|
|
3813
|
-
this.updateProperty(types_1.PropertyName.DeviceLongTimeNotCloseAlert, true);
|
|
3814
|
-
this.clearEventTimeout(types_1.DeviceEvent.LongTimeNotClose);
|
|
3815
|
-
this.eventTimeouts.set(types_1.DeviceEvent.LongTimeNotClose, setTimeout(async () => {
|
|
3816
|
-
this.updateProperty(types_1.PropertyName.DeviceLongTimeNotCloseAlert, false);
|
|
3817
|
-
this.eventTimeouts.delete(types_1.DeviceEvent.LongTimeNotClose);
|
|
3818
|
-
}, eventDurationSeconds * 1000));
|
|
3819
|
-
}
|
|
3820
|
-
break;
|
|
4625
|
+
else if (eventValues.action === 2) {
|
|
4626
|
+
this.jammedEvent(eventDurationSeconds);
|
|
3821
4627
|
}
|
|
3822
|
-
|
|
3823
|
-
{
|
|
4628
|
+
else if (eventValues.action === 3) {
|
|
3824
4629
|
this.lowBatteryEvent(eventDurationSeconds);
|
|
3825
|
-
break;
|
|
3826
4630
|
}
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
4631
|
+
break;
|
|
4632
|
+
}
|
|
4633
|
+
case types_3.SmartSafeEvent.ALARM_911: {
|
|
4634
|
+
const eventValue = message.event_value;
|
|
4635
|
+
this.alarm911Event(eventValue, eventDurationSeconds);
|
|
4636
|
+
break;
|
|
4637
|
+
}
|
|
4638
|
+
case types_3.SmartSafeEvent.SHAKE_ALARM: {
|
|
4639
|
+
const eventValue = message.event_value;
|
|
4640
|
+
this.shakeEvent(eventValue, eventDurationSeconds);
|
|
4641
|
+
break;
|
|
4642
|
+
}
|
|
4643
|
+
case types_3.SmartSafeEvent.LONG_TIME_NOT_CLOSE: {
|
|
4644
|
+
const eventValue = message.event_value;
|
|
4645
|
+
if (eventValue === 1) {
|
|
4646
|
+
this.updateProperty(types_1.PropertyName.DeviceLongTimeNotCloseAlert, true);
|
|
4647
|
+
this.clearEventTimeout(types_1.DeviceEvent.LongTimeNotClose);
|
|
4648
|
+
this.eventTimeouts.set(types_1.DeviceEvent.LongTimeNotClose, setTimeout(async () => {
|
|
4649
|
+
this.updateProperty(types_1.PropertyName.DeviceLongTimeNotCloseAlert, false);
|
|
4650
|
+
this.eventTimeouts.delete(types_1.DeviceEvent.LongTimeNotClose);
|
|
4651
|
+
}, eventDurationSeconds * 1000));
|
|
3831
4652
|
}
|
|
4653
|
+
break;
|
|
4654
|
+
}
|
|
4655
|
+
case types_3.SmartSafeEvent.LOW_POWER: {
|
|
4656
|
+
this.lowBatteryEvent(eventDurationSeconds);
|
|
4657
|
+
break;
|
|
4658
|
+
}
|
|
4659
|
+
case types_3.SmartSafeEvent.INPUT_ERR_MAX: {
|
|
4660
|
+
this.wrongTryProtectAlarmEvent(eventDurationSeconds);
|
|
4661
|
+
break;
|
|
4662
|
+
}
|
|
3832
4663
|
default:
|
|
3833
4664
|
logging_1.rootHTTPLogger.debug("SmartSafe process push notification - Unhandled smart safe notification event", message.event_type, message.event_time, message.device_sn);
|
|
3834
4665
|
break;
|
|
@@ -3836,7 +4667,12 @@ class SmartSafe extends Device {
|
|
|
3836
4667
|
}
|
|
3837
4668
|
catch (err) {
|
|
3838
4669
|
const error = (0, error_2.ensureError)(err);
|
|
3839
|
-
logging_1.rootHTTPLogger.debug(`SmartSafe process push notification - Error`, {
|
|
4670
|
+
logging_1.rootHTTPLogger.debug(`SmartSafe process push notification - Error`, {
|
|
4671
|
+
error: (0, utils_3.getError)(error),
|
|
4672
|
+
deviceSN: this.getSerial(),
|
|
4673
|
+
message: JSON.stringify(message),
|
|
4674
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
4675
|
+
});
|
|
3840
4676
|
}
|
|
3841
4677
|
}
|
|
3842
4678
|
}
|
|
@@ -3889,27 +4725,32 @@ class Tracker extends Device {
|
|
|
3889
4725
|
convertRawPropertyValue(property, value) {
|
|
3890
4726
|
try {
|
|
3891
4727
|
switch (property.key) {
|
|
3892
|
-
case types_2.TrackerCommandType.COMMAND_NEW_LOCATION:
|
|
3893
|
-
{
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
}
|
|
4728
|
+
case types_2.TrackerCommandType.COMMAND_NEW_LOCATION: {
|
|
4729
|
+
if (value !== undefined && typeof value === "string") {
|
|
4730
|
+
const items = value.split(",");
|
|
4731
|
+
if (items.length === 3) {
|
|
4732
|
+
switch (property.name) {
|
|
4733
|
+
case types_1.PropertyName.DeviceLocationCoordinates:
|
|
4734
|
+
return `${items[1]},${items[0]}`;
|
|
4735
|
+
case types_1.PropertyName.DeviceLocationLastUpdate:
|
|
4736
|
+
return Number.parseInt(items[2]);
|
|
4737
|
+
default:
|
|
4738
|
+
break;
|
|
3904
4739
|
}
|
|
3905
4740
|
}
|
|
3906
|
-
break;
|
|
3907
4741
|
}
|
|
4742
|
+
break;
|
|
4743
|
+
}
|
|
3908
4744
|
}
|
|
3909
4745
|
}
|
|
3910
4746
|
catch (err) {
|
|
3911
4747
|
const error = (0, error_2.ensureError)(err);
|
|
3912
|
-
logging_1.rootHTTPLogger.error("Tracker convert raw property - Error", {
|
|
4748
|
+
logging_1.rootHTTPLogger.error("Tracker convert raw property - Error", {
|
|
4749
|
+
error: (0, utils_3.getError)(error),
|
|
4750
|
+
deviceSN: this.getSerial(),
|
|
4751
|
+
property: property,
|
|
4752
|
+
value: value,
|
|
4753
|
+
});
|
|
3913
4754
|
}
|
|
3914
4755
|
return super.convertRawPropertyValue(property, value);
|
|
3915
4756
|
}
|
|
@@ -3917,14 +4758,20 @@ class Tracker extends Device {
|
|
|
3917
4758
|
try {
|
|
3918
4759
|
const property = this.getPropertyMetadata(types_1.PropertyName.DeviceFindPhone);
|
|
3919
4760
|
(0, utils_3.validValue)(property, value);
|
|
3920
|
-
return await this.setParameters([
|
|
4761
|
+
return await this.setParameters([
|
|
4762
|
+
{
|
|
3921
4763
|
paramType: types_2.TrackerCommandType.COMMAND_TYPE_FINDMYPHONE,
|
|
3922
|
-
paramValue: value ? "1" : "0"
|
|
3923
|
-
}
|
|
4764
|
+
paramValue: value ? "1" : "0",
|
|
4765
|
+
},
|
|
4766
|
+
]);
|
|
3924
4767
|
}
|
|
3925
4768
|
catch (err) {
|
|
3926
4769
|
const error = (0, error_2.ensureError)(err);
|
|
3927
|
-
logging_1.rootHTTPLogger.error("Tracker set find phone - Error", {
|
|
4770
|
+
logging_1.rootHTTPLogger.error("Tracker set find phone - Error", {
|
|
4771
|
+
error: (0, utils_3.getError)(error),
|
|
4772
|
+
deviceSN: this.getSerial(),
|
|
4773
|
+
value: value,
|
|
4774
|
+
});
|
|
3928
4775
|
}
|
|
3929
4776
|
return false;
|
|
3930
4777
|
}
|
|
@@ -3932,14 +4779,20 @@ class Tracker extends Device {
|
|
|
3932
4779
|
try {
|
|
3933
4780
|
const property = this.getPropertyMetadata(types_1.PropertyName.DeviceLeftBehindAlarm);
|
|
3934
4781
|
(0, utils_3.validValue)(property, value);
|
|
3935
|
-
return await this.setParameters([
|
|
4782
|
+
return await this.setParameters([
|
|
4783
|
+
{
|
|
3936
4784
|
paramType: types_2.TrackerCommandType.COMMAND_ANTILOST,
|
|
3937
|
-
paramValue: value ? "1" : "0"
|
|
3938
|
-
}
|
|
4785
|
+
paramValue: value ? "1" : "0",
|
|
4786
|
+
},
|
|
4787
|
+
]);
|
|
3939
4788
|
}
|
|
3940
4789
|
catch (err) {
|
|
3941
4790
|
const error = (0, error_2.ensureError)(err);
|
|
3942
|
-
logging_1.rootHTTPLogger.error("Tracker set left behind alarm - Error", {
|
|
4791
|
+
logging_1.rootHTTPLogger.error("Tracker set left behind alarm - Error", {
|
|
4792
|
+
error: (0, utils_3.getError)(error),
|
|
4793
|
+
deviceSN: this.getSerial(),
|
|
4794
|
+
value: value,
|
|
4795
|
+
});
|
|
3943
4796
|
}
|
|
3944
4797
|
return false;
|
|
3945
4798
|
}
|
|
@@ -3947,14 +4800,20 @@ class Tracker extends Device {
|
|
|
3947
4800
|
try {
|
|
3948
4801
|
const property = this.getPropertyMetadata(types_1.PropertyName.DeviceTrackerType);
|
|
3949
4802
|
(0, utils_3.validValue)(property, value);
|
|
3950
|
-
return await this.setParameters([
|
|
4803
|
+
return await this.setParameters([
|
|
4804
|
+
{
|
|
3951
4805
|
paramType: types_2.TrackerCommandType.TYPE_ICON_INDEX,
|
|
3952
|
-
paramValue: value.toString()
|
|
3953
|
-
}
|
|
4806
|
+
paramValue: value.toString(),
|
|
4807
|
+
},
|
|
4808
|
+
]);
|
|
3954
4809
|
}
|
|
3955
4810
|
catch (err) {
|
|
3956
4811
|
const error = (0, error_2.ensureError)(err);
|
|
3957
|
-
logging_1.rootHTTPLogger.error("Tracker set tracker type - Error", {
|
|
4812
|
+
logging_1.rootHTTPLogger.error("Tracker set tracker type - Error", {
|
|
4813
|
+
error: (0, utils_3.getError)(error),
|
|
4814
|
+
deviceSN: this.getSerial(),
|
|
4815
|
+
value: value,
|
|
4816
|
+
});
|
|
3958
4817
|
}
|
|
3959
4818
|
return false;
|
|
3960
4819
|
}
|
|
@@ -3976,7 +4835,10 @@ class DoorbellLock extends DoorbellCamera {
|
|
|
3976
4835
|
else if (metadata.name === types_1.PropertyName.DeviceLowBatteryAlert) {
|
|
3977
4836
|
this.emit("low battery", this, newValue);
|
|
3978
4837
|
}
|
|
3979
|
-
else if ((metadata.key === types_2.CommandType.CMD_DOORLOCK_GET_STATE ||
|
|
4838
|
+
else if ((metadata.key === types_2.CommandType.CMD_DOORLOCK_GET_STATE ||
|
|
4839
|
+
metadata.key === types_2.CommandType.CMD_SMARTLOCK_QUERY_STATUS) &&
|
|
4840
|
+
((oldValue !== undefined && ((oldValue === 4 && newValue !== 4) || (oldValue !== 4 && newValue === 4))) ||
|
|
4841
|
+
oldValue === undefined)) {
|
|
3980
4842
|
this.updateProperty(types_1.PropertyName.DeviceLocked, newValue === 4 ? true : false);
|
|
3981
4843
|
}
|
|
3982
4844
|
}
|
|
@@ -3989,7 +4851,12 @@ class DoorbellLock extends DoorbellCamera {
|
|
|
3989
4851
|
}
|
|
3990
4852
|
catch (err) {
|
|
3991
4853
|
const error = (0, error_2.ensureError)(err);
|
|
3992
|
-
logging_1.rootHTTPLogger.error("DoorbellLock convert raw property - Error", {
|
|
4854
|
+
logging_1.rootHTTPLogger.error("DoorbellLock convert raw property - Error", {
|
|
4855
|
+
error: (0, utils_3.getError)(error),
|
|
4856
|
+
deviceSN: this.getSerial(),
|
|
4857
|
+
property: property,
|
|
4858
|
+
value: value,
|
|
4859
|
+
});
|
|
3993
4860
|
}
|
|
3994
4861
|
return super.convertRawPropertyValue(property, value);
|
|
3995
4862
|
}
|
|
@@ -4020,52 +4887,55 @@ class DoorbellLock extends DoorbellCamera {
|
|
|
4020
4887
|
case types_3.LockPushEvent.KEYPAD_LOCK:
|
|
4021
4888
|
case types_3.LockPushEvent.MANUAL_LOCK:
|
|
4022
4889
|
case types_3.LockPushEvent.PW_LOCK:
|
|
4023
|
-
case types_3.LockPushEvent.TEMPORARY_PW_LOCK:
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
}
|
|
4037
|
-
break;
|
|
4890
|
+
case types_3.LockPushEvent.TEMPORARY_PW_LOCK: {
|
|
4891
|
+
const cmdType = this.isLockBle() || this.isLockBleNoFinger()
|
|
4892
|
+
? types_2.CommandType.CMD_DOORLOCK_GET_STATE
|
|
4893
|
+
: types_2.CommandType.CMD_SMARTLOCK_QUERY_STATUS;
|
|
4894
|
+
this.updateRawProperty(cmdType, "4", "push");
|
|
4895
|
+
if (!(0, utils_3.isEmpty)(message.person_name)) {
|
|
4896
|
+
this.updateProperty(types_1.PropertyName.DevicePersonName, message.person_name);
|
|
4897
|
+
this.updateProperty(types_1.PropertyName.DeviceLockEventOrigin, (0, utils_1.getLockEventType)(message.event_type));
|
|
4898
|
+
this.clearEventTimeout(types_1.DeviceEvent.Lock);
|
|
4899
|
+
this.eventTimeouts.set(types_1.DeviceEvent.Lock, setTimeout(async () => {
|
|
4900
|
+
this.updateProperty(types_1.PropertyName.DevicePersonName, "");
|
|
4901
|
+
this.updateProperty(types_1.PropertyName.DeviceLockEventOrigin, 0);
|
|
4902
|
+
this.eventTimeouts.delete(types_1.DeviceEvent.Lock);
|
|
4903
|
+
}, eventDurationSeconds * 1000));
|
|
4038
4904
|
}
|
|
4905
|
+
break;
|
|
4906
|
+
}
|
|
4039
4907
|
case types_3.LockPushEvent.APP_UNLOCK:
|
|
4040
4908
|
case types_3.LockPushEvent.AUTO_UNLOCK:
|
|
4041
4909
|
case types_3.LockPushEvent.FINGERPRINT_UNLOCK:
|
|
4042
4910
|
case types_3.LockPushEvent.MANUAL_UNLOCK:
|
|
4043
4911
|
case types_3.LockPushEvent.PW_UNLOCK:
|
|
4044
|
-
case types_3.LockPushEvent.TEMPORARY_PW_UNLOCK:
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
}
|
|
4058
|
-
break;
|
|
4912
|
+
case types_3.LockPushEvent.TEMPORARY_PW_UNLOCK: {
|
|
4913
|
+
const cmdType = this.isLockBle() || this.isLockBleNoFinger()
|
|
4914
|
+
? types_2.CommandType.CMD_DOORLOCK_GET_STATE
|
|
4915
|
+
: types_2.CommandType.CMD_SMARTLOCK_QUERY_STATUS;
|
|
4916
|
+
this.updateRawProperty(cmdType, "3", "push");
|
|
4917
|
+
if (!(0, utils_3.isEmpty)(message.person_name)) {
|
|
4918
|
+
this.updateProperty(types_1.PropertyName.DevicePersonName, message.person_name);
|
|
4919
|
+
this.updateProperty(types_1.PropertyName.DeviceLockEventOrigin, (0, utils_1.getLockEventType)(message.event_type));
|
|
4920
|
+
this.clearEventTimeout(types_1.DeviceEvent.Lock);
|
|
4921
|
+
this.eventTimeouts.set(types_1.DeviceEvent.Lock, setTimeout(async () => {
|
|
4922
|
+
this.updateProperty(types_1.PropertyName.DevicePersonName, "");
|
|
4923
|
+
this.updateProperty(types_1.PropertyName.DeviceLockEventOrigin, 0);
|
|
4924
|
+
this.eventTimeouts.delete(types_1.DeviceEvent.Lock);
|
|
4925
|
+
}, eventDurationSeconds * 1000));
|
|
4059
4926
|
}
|
|
4927
|
+
break;
|
|
4928
|
+
}
|
|
4060
4929
|
case types_3.LockPushEvent.LOCK_MECHANICAL_ANOMALY:
|
|
4061
4930
|
case types_3.LockPushEvent.MECHANICAL_ANOMALY:
|
|
4062
4931
|
case types_3.LockPushEvent.VIOLENT_DESTRUCTION:
|
|
4063
|
-
case types_3.LockPushEvent.MULTIPLE_ERRORS:
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4932
|
+
case types_3.LockPushEvent.MULTIPLE_ERRORS: {
|
|
4933
|
+
const cmdType = this.isLockBle() || this.isLockBleNoFinger()
|
|
4934
|
+
? types_2.CommandType.CMD_DOORLOCK_GET_STATE
|
|
4935
|
+
: types_2.CommandType.CMD_SMARTLOCK_QUERY_STATUS;
|
|
4936
|
+
this.updateRawProperty(cmdType, "5", "push");
|
|
4937
|
+
break;
|
|
4938
|
+
}
|
|
4069
4939
|
case types_3.LockPushEvent.LOW_POWER:
|
|
4070
4940
|
case types_3.LockPushEvent.VERY_LOW_POWER:
|
|
4071
4941
|
this.updateProperty(types_1.PropertyName.DeviceLowBatteryAlert, true);
|
|
@@ -4082,13 +4952,23 @@ class DoorbellLock extends DoorbellCamera {
|
|
|
4082
4952
|
case types_3.LockPushEvent.DOOR_STATE_ERROR: //TODO: Implement event
|
|
4083
4953
|
break;
|
|
4084
4954
|
default:
|
|
4085
|
-
logging_1.rootHTTPLogger.debug("DoorbellLock process push notification - Unhandled lock notification event", {
|
|
4955
|
+
logging_1.rootHTTPLogger.debug("DoorbellLock process push notification - Unhandled lock notification event", {
|
|
4956
|
+
eventType: message.event_type,
|
|
4957
|
+
eventTime: message.event_time,
|
|
4958
|
+
deviceSN: this.getSerial(),
|
|
4959
|
+
});
|
|
4086
4960
|
break;
|
|
4087
4961
|
}
|
|
4088
4962
|
}
|
|
4089
4963
|
catch (err) {
|
|
4090
4964
|
const error = (0, error_2.ensureError)(err);
|
|
4091
|
-
logging_1.rootHTTPLogger.debug(`DoorbellLock process push notification - Error`, {
|
|
4965
|
+
logging_1.rootHTTPLogger.debug(`DoorbellLock process push notification - Error`, {
|
|
4966
|
+
error: (0, utils_3.getError)(error),
|
|
4967
|
+
deviceSN: this.getSerial(),
|
|
4968
|
+
eventType: message.event_type,
|
|
4969
|
+
eventTime: message.event_time,
|
|
4970
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
4971
|
+
});
|
|
4092
4972
|
}
|
|
4093
4973
|
}
|
|
4094
4974
|
}
|
|
@@ -4253,7 +5133,12 @@ class SmartDrop extends Camera {
|
|
|
4253
5133
|
}
|
|
4254
5134
|
catch (err) {
|
|
4255
5135
|
const error = (0, error_2.ensureError)(err);
|
|
4256
|
-
logging_1.rootHTTPLogger.debug(`SmartDrop process push notification - Error`, {
|
|
5136
|
+
logging_1.rootHTTPLogger.debug(`SmartDrop process push notification - Error`, {
|
|
5137
|
+
error: (0, utils_3.getError)(error),
|
|
5138
|
+
deviceSN: this.getSerial(),
|
|
5139
|
+
message: JSON.stringify(message),
|
|
5140
|
+
eventDurationSeconds: eventDurationSeconds,
|
|
5141
|
+
});
|
|
4257
5142
|
}
|
|
4258
5143
|
}
|
|
4259
5144
|
}
|