eufy-security-client 2.6.2 → 2.7.0
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/LICENSE +21 -21
- package/README.md +762 -745
- package/build/error.d.ts +126 -56
- package/build/error.js +80 -58
- package/build/error.js.map +1 -1
- package/build/eufysecurity.d.ts +4 -2
- package/build/eufysecurity.js +372 -184
- package/build/eufysecurity.js.map +1 -1
- package/build/http/api.js +164 -113
- package/build/http/api.js.map +1 -1
- package/build/http/cache.js +2 -2
- package/build/http/cache.js.map +1 -1
- package/build/http/device.d.ts +26 -1
- package/build/http/device.js +544 -167
- package/build/http/device.js.map +1 -1
- package/build/http/error.d.ts +64 -19
- package/build/http/error.js +53 -29
- package/build/http/error.js.map +1 -1
- package/build/http/interfaces.d.ts +3 -0
- package/build/http/models.d.ts +25 -0
- package/build/http/parameter.d.ts +1 -1
- package/build/http/parameter.js +19 -17
- package/build/http/parameter.js.map +1 -1
- package/build/http/station.d.ts +30 -6
- package/build/http/station.js +1599 -530
- package/build/http/station.js.map +1 -1
- package/build/http/types.d.ts +125 -2
- package/build/http/types.js +932 -53
- package/build/http/types.js.map +1 -1
- package/build/http/utils.js +11 -9
- package/build/http/utils.js.map +1 -1
- package/build/mqtt/service.js +19 -16
- package/build/mqtt/service.js.map +1 -1
- package/build/p2p/ble.js +14 -6
- package/build/p2p/ble.js.map +1 -1
- package/build/p2p/error.d.ts +48 -23
- package/build/p2p/error.js +25 -24
- package/build/p2p/error.js.map +1 -1
- package/build/p2p/interfaces.d.ts +23 -0
- package/build/p2p/models.d.ts +11 -1
- package/build/p2p/session.d.ts +5 -0
- package/build/p2p/session.js +210 -142
- package/build/p2p/session.js.map +1 -1
- package/build/p2p/talkback.js +1 -1
- package/build/p2p/talkback.js.map +1 -1
- package/build/p2p/types.d.ts +36 -1
- package/build/p2p/types.js +72 -31
- package/build/p2p/types.js.map +1 -1
- package/build/p2p/utils.d.ts +3 -1
- package/build/p2p/utils.js +13 -1
- package/build/p2p/utils.js.map +1 -1
- package/build/push/client.js +24 -15
- package/build/push/client.js.map +1 -1
- package/build/push/error.d.ts +73 -0
- package/build/push/error.js +101 -0
- package/build/push/error.js.map +1 -0
- package/build/push/index.d.ts +1 -0
- package/build/push/index.js +1 -0
- package/build/push/index.js.map +1 -1
- package/build/push/models.d.ts +17 -1
- package/build/push/models.js +9 -2
- package/build/push/models.js.map +1 -1
- package/build/push/parser.js +17 -13
- package/build/push/parser.js.map +1 -1
- package/build/push/service.js +160 -62
- package/build/push/service.js.map +1 -1
- package/build/push/types.d.ts +10 -0
- package/build/push/types.js +25 -14
- package/build/push/types.js.map +1 -1
- package/build/push/utils.js +2 -1
- package/build/push/utils.js.map +1 -1
- package/build/utils.d.ts +2 -1
- package/build/utils.js +56 -26
- package/build/utils.js.map +1 -1
- package/package.json +77 -77
package/build/http/station.js
CHANGED
|
@@ -18,15 +18,23 @@ const types_3 = require("../push/types");
|
|
|
18
18
|
const error_2 = require("./error");
|
|
19
19
|
const utils_3 = require("../utils");
|
|
20
20
|
class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
21
|
+
api;
|
|
22
|
+
rawStation;
|
|
23
|
+
log;
|
|
24
|
+
p2pSession;
|
|
25
|
+
properties = {};
|
|
26
|
+
rawProperties = {};
|
|
27
|
+
ready = false;
|
|
28
|
+
lockPublicKey;
|
|
29
|
+
currentDelay = 0;
|
|
30
|
+
reconnectTimeout;
|
|
31
|
+
terminating = false;
|
|
32
|
+
p2pConnectionType = types_2.P2PConnectionType.QUICKEST;
|
|
33
|
+
static CHANNEL = 255;
|
|
34
|
+
static CHANNEL_INDOOR = 1000;
|
|
35
|
+
pinVerified = false;
|
|
21
36
|
constructor(api, station, ipAddress, publicKey = "") {
|
|
22
37
|
super();
|
|
23
|
-
this.properties = {};
|
|
24
|
-
this.rawProperties = {};
|
|
25
|
-
this.ready = false;
|
|
26
|
-
this.currentDelay = 0;
|
|
27
|
-
this.terminating = false;
|
|
28
|
-
this.p2pConnectionType = types_2.P2PConnectionType.QUICKEST;
|
|
29
|
-
this.pinVerified = false;
|
|
30
38
|
this.api = api;
|
|
31
39
|
this.rawStation = station;
|
|
32
40
|
this.lockPublicKey = publicKey;
|
|
@@ -70,6 +78,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
70
78
|
this.p2pSession.on("database query local", (returnCode, data) => this.onDatabaseQueryLocal(returnCode, data));
|
|
71
79
|
this.p2pSession.on("database count by date", (returnCode, data) => this.onDatabaseCountByDate(returnCode, data));
|
|
72
80
|
this.p2pSession.on("database delete", (returnCode, failedIds) => this.onDatabaseDelete(returnCode, failedIds));
|
|
81
|
+
this.p2pSession.on("sensor status", (channel, status) => this.onSensorStatus(channel, status));
|
|
82
|
+
this.p2pSession.on("garage door status", (channel, doorId, status) => this.onGarageDoorStatus(channel, doorId, status));
|
|
73
83
|
}
|
|
74
84
|
initializeState() {
|
|
75
85
|
this.update(this.rawStation);
|
|
@@ -88,6 +98,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
88
98
|
}
|
|
89
99
|
return new Station(api, stationData, ipAddress, publicKey);
|
|
90
100
|
}
|
|
101
|
+
//TODO: To remove
|
|
91
102
|
getStateID(state, level = 2) {
|
|
92
103
|
switch (level) {
|
|
93
104
|
case 0:
|
|
@@ -125,16 +136,17 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
125
136
|
}
|
|
126
137
|
this.log.debug("Normalized Properties", { stationSN: this.getSerial(), properties: this.properties });
|
|
127
138
|
}
|
|
128
|
-
updateProperty(name, value) {
|
|
139
|
+
updateProperty(name, value, force = false) {
|
|
129
140
|
if ((this.properties[name] !== undefined && this.properties[name] !== value)
|
|
130
|
-
|| this.properties[name] === undefined) {
|
|
141
|
+
|| this.properties[name] === undefined || force) {
|
|
131
142
|
const oldValue = this.properties[name];
|
|
132
143
|
this.properties[name] = value;
|
|
133
144
|
this.emit("property changed", this, name, value, this.ready);
|
|
134
145
|
try {
|
|
135
146
|
this.handlePropertyChange(this.getPropertyMetadata(name, true), oldValue, this.properties[name]);
|
|
136
147
|
}
|
|
137
|
-
catch (
|
|
148
|
+
catch (err) {
|
|
149
|
+
const error = (0, error_1.ensureError)(err);
|
|
138
150
|
if (error instanceof error_2.InvalidPropertyError) {
|
|
139
151
|
this.log.error(`Invalid Property ${name} error`, error);
|
|
140
152
|
}
|
|
@@ -179,8 +191,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
179
191
|
}
|
|
180
192
|
updateRawProperty(type, value) {
|
|
181
193
|
const parsedValue = parameter_1.ParameterHelper.readValue(type, value, this.log);
|
|
182
|
-
if ((this.rawProperties[type] !== undefined && this.rawProperties[type] !== parsedValue)
|
|
183
|
-
|| this.rawProperties[type] === undefined) {
|
|
194
|
+
if (parsedValue !== undefined && ((this.rawProperties[type] !== undefined && this.rawProperties[type] !== parsedValue)
|
|
195
|
+
|| this.rawProperties[type] === undefined)) {
|
|
184
196
|
this.rawProperties[type] = parsedValue;
|
|
185
197
|
if (this.ready) {
|
|
186
198
|
this.emit("raw property changed", this, type, this.rawProperties[type]);
|
|
@@ -192,7 +204,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
192
204
|
this.emit("current mode", this, Number.parseInt(parsedValue));
|
|
193
205
|
}
|
|
194
206
|
}
|
|
195
|
-
catch (
|
|
207
|
+
catch (err) {
|
|
208
|
+
const error = (0, error_1.ensureError)(err);
|
|
196
209
|
this.log.error("Number conversion error", error);
|
|
197
210
|
}
|
|
198
211
|
}
|
|
@@ -202,7 +215,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
202
215
|
try {
|
|
203
216
|
this.updateProperty(property.name, this.convertRawPropertyValue(property, this.rawProperties[type]));
|
|
204
217
|
}
|
|
205
|
-
catch (
|
|
218
|
+
catch (err) {
|
|
219
|
+
const error = (0, error_1.ensureError)(err);
|
|
206
220
|
if (error instanceof error_2.PropertyNotSupportedError) {
|
|
207
221
|
this.log.debug("Property not supported error", error);
|
|
208
222
|
}
|
|
@@ -238,17 +252,17 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
238
252
|
return value !== undefined ? (0, utils_1.isNotificationSwitchMode)(Number.parseInt(value), types_1.NotificationSwitchMode.SCHEDULE) : false;
|
|
239
253
|
case types_1.PropertyName.StationNotificationSwitchModeGeofence:
|
|
240
254
|
if (!(0, utils_1.isGreaterEqualMinVersion)("2.1.1.6", this.getSoftwareVersion())) {
|
|
241
|
-
throw new error_2.PropertyNotSupportedError(
|
|
255
|
+
throw new error_2.PropertyNotSupportedError("Property not supported for station with this software version", { context: { propertName: property.name, station: this.getSerial(), softwareVersion: this.getSoftwareVersion() } });
|
|
242
256
|
}
|
|
243
257
|
return value !== undefined ? (0, utils_1.isNotificationSwitchMode)(Number.parseInt(value), types_1.NotificationSwitchMode.GEOFENCE) : false;
|
|
244
258
|
case types_1.PropertyName.StationNotificationSwitchModeApp:
|
|
245
259
|
if (!(0, utils_1.isGreaterEqualMinVersion)("2.1.1.6", this.getSoftwareVersion())) {
|
|
246
|
-
throw new error_2.PropertyNotSupportedError(
|
|
260
|
+
throw new error_2.PropertyNotSupportedError("Property not supported for station with this software version", { context: { propertName: property.name, station: this.getSerial(), softwareVersion: this.getSoftwareVersion() } });
|
|
247
261
|
}
|
|
248
262
|
return value !== undefined ? (0, utils_1.isNotificationSwitchMode)(Number.parseInt(value), types_1.NotificationSwitchMode.APP) : false;
|
|
249
263
|
case types_1.PropertyName.StationNotificationSwitchModeKeypad:
|
|
250
264
|
if (!(0, utils_1.isGreaterEqualMinVersion)("2.1.1.6", this.getSoftwareVersion())) {
|
|
251
|
-
throw new error_2.PropertyNotSupportedError(
|
|
265
|
+
throw new error_2.PropertyNotSupportedError("Property not supported for station with this software version", { context: { propertName: property.name, station: this.getSerial(), softwareVersion: this.getSoftwareVersion() } });
|
|
252
266
|
}
|
|
253
267
|
return value !== undefined ? (0, utils_1.isNotificationSwitchMode)(Number.parseInt(value), types_1.NotificationSwitchMode.KEYPAD) : false;
|
|
254
268
|
}
|
|
@@ -259,32 +273,36 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
259
273
|
try {
|
|
260
274
|
return value !== undefined ? Number.parseInt(value) : 1;
|
|
261
275
|
}
|
|
262
|
-
catch (
|
|
263
|
-
|
|
276
|
+
catch (err) {
|
|
277
|
+
const error = (0, error_1.ensureError)(err);
|
|
278
|
+
this.log.error("Convert CMD_HUB_ALARM_TONE Error", { property: property, value: value, error: error });
|
|
264
279
|
return 1;
|
|
265
280
|
}
|
|
266
281
|
case types_2.CommandType.CMD_SET_HUB_SPK_VOLUME:
|
|
267
282
|
try {
|
|
268
283
|
return value !== undefined ? Number.parseInt(value) : 26;
|
|
269
284
|
}
|
|
270
|
-
catch (
|
|
271
|
-
|
|
285
|
+
catch (err) {
|
|
286
|
+
const error = (0, error_1.ensureError)(err);
|
|
287
|
+
this.log.error("Convert CMD_SET_HUB_SPK_VOLUME Error", { property: property, value: value, error: error });
|
|
272
288
|
return 26;
|
|
273
289
|
}
|
|
274
290
|
case types_2.CommandType.CMD_SET_PROMPT_VOLUME:
|
|
275
291
|
try {
|
|
276
292
|
return value !== undefined ? Number.parseInt(value) : 26;
|
|
277
293
|
}
|
|
278
|
-
catch (
|
|
279
|
-
|
|
294
|
+
catch (err) {
|
|
295
|
+
const error = (0, error_1.ensureError)(err);
|
|
296
|
+
this.log.error("Convert CMD_SET_PROMPT_VOLUME Error", { property: property, value: value, error: error });
|
|
280
297
|
return 26;
|
|
281
298
|
}
|
|
282
299
|
case types_2.CommandType.CMD_SET_HUB_OSD:
|
|
283
300
|
try {
|
|
284
301
|
return value !== undefined ? Number.parseInt(value) : 0;
|
|
285
302
|
}
|
|
286
|
-
catch (
|
|
287
|
-
|
|
303
|
+
catch (err) {
|
|
304
|
+
const error = (0, error_1.ensureError)(err);
|
|
305
|
+
this.log.error("Convert CMD_SET_HUB_OSD Error", { property: property, value: value, error: error });
|
|
288
306
|
return 0;
|
|
289
307
|
}
|
|
290
308
|
case types_2.CommandType.CMD_SET_HUB_ALARM_AUTO_END:
|
|
@@ -297,8 +315,9 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
297
315
|
try {
|
|
298
316
|
return value !== undefined ? Number.parseInt(value) : (numericProperty.default !== undefined ? numericProperty.default : (numericProperty.min !== undefined ? numericProperty.min : 0));
|
|
299
317
|
}
|
|
300
|
-
catch (
|
|
301
|
-
|
|
318
|
+
catch (err) {
|
|
319
|
+
const error = (0, error_1.ensureError)(err);
|
|
320
|
+
this.log.warn("PropertyMetadataNumeric Convert Error", { property: property, value: value, error: error });
|
|
302
321
|
return numericProperty.default !== undefined ? numericProperty.default : (numericProperty.min !== undefined ? numericProperty.min : 0);
|
|
303
322
|
}
|
|
304
323
|
}
|
|
@@ -307,8 +326,9 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
307
326
|
try {
|
|
308
327
|
return value !== undefined ? (value === "1" || value.toLowerCase() === "true" ? true : false) : (booleanProperty.default !== undefined ? booleanProperty.default : false);
|
|
309
328
|
}
|
|
310
|
-
catch (
|
|
311
|
-
|
|
329
|
+
catch (err) {
|
|
330
|
+
const error = (0, error_1.ensureError)(err);
|
|
331
|
+
this.log.warn("PropertyMetadataBoolean Convert Error", { property: property, value: value, error: error });
|
|
312
332
|
return booleanProperty.default !== undefined ? booleanProperty.default : false;
|
|
313
333
|
}
|
|
314
334
|
}
|
|
@@ -321,8 +341,9 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
321
341
|
return value !== undefined ? value : (objectProperty.default !== undefined ? objectProperty.default : undefined);
|
|
322
342
|
}
|
|
323
343
|
}
|
|
324
|
-
catch (
|
|
325
|
-
|
|
344
|
+
catch (err) {
|
|
345
|
+
const error = (0, error_1.ensureError)(err);
|
|
346
|
+
this.log.error("Convert Error", { property: property, value: value, error: error });
|
|
326
347
|
}
|
|
327
348
|
return value;
|
|
328
349
|
}
|
|
@@ -330,7 +351,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
330
351
|
const property = this.getPropertiesMetadata(hidden)[name];
|
|
331
352
|
if (property !== undefined)
|
|
332
353
|
return property;
|
|
333
|
-
throw new error_2.InvalidPropertyError(
|
|
354
|
+
throw new error_2.InvalidPropertyError("Property name is not valid", { context: { name: name } });
|
|
334
355
|
}
|
|
335
356
|
getPropertyValue(name) {
|
|
336
357
|
if (name === types_1.PropertyName.StationCurrentMode) {
|
|
@@ -360,9 +381,9 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
360
381
|
let metadata = {
|
|
361
382
|
...types_1.StationProperties[this.getDeviceType()]
|
|
362
383
|
};
|
|
363
|
-
if (metadata ===
|
|
384
|
+
if (Object.keys(metadata).length === 0) {
|
|
364
385
|
metadata = {
|
|
365
|
-
...types_1.
|
|
386
|
+
...types_1.BaseStationProperties
|
|
366
387
|
};
|
|
367
388
|
}
|
|
368
389
|
if (this.hasDeviceWithType(types_1.DeviceType.KEYPAD)) {
|
|
@@ -402,14 +423,19 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
402
423
|
return Station.isStation(this.rawStation.device_type);
|
|
403
424
|
}
|
|
404
425
|
isIntegratedDevice() {
|
|
405
|
-
var _a, _b;
|
|
406
426
|
if (device_1.Device.isLock(this.getDeviceType()) || device_1.Device.isSmartDrop(this.getDeviceType()) || device_1.Device.isSmartSafe(this.getDeviceType())) {
|
|
407
|
-
if (
|
|
408
|
-
return
|
|
427
|
+
if (this.rawStation.devices?.length === 1)
|
|
428
|
+
return this.rawStation.devices[0]?.device_sn === this.rawStation.station_sn;
|
|
409
429
|
else
|
|
410
430
|
return true;
|
|
411
431
|
}
|
|
412
|
-
return device_1.Device.isWiredDoorbellDual(this.getDeviceType()) || device_1.Device.isFloodLight(this.getDeviceType()) || device_1.Device.isWiredDoorbell(this.getDeviceType()) || device_1.Device.isIndoorCamera(this.getDeviceType()) || device_1.Device.isSoloCameras(this.getDeviceType());
|
|
432
|
+
return device_1.Device.isWiredDoorbellDual(this.getDeviceType()) || device_1.Device.isFloodLight(this.getDeviceType()) || device_1.Device.isWiredDoorbell(this.getDeviceType()) || device_1.Device.isIndoorCamera(this.getDeviceType()) || device_1.Device.isSoloCameras(this.getDeviceType()) || device_1.Device.isWallLightCam(this.getDeviceType());
|
|
433
|
+
}
|
|
434
|
+
isP2PConnectableDevice() {
|
|
435
|
+
if (!device_1.Device.isSmartTrack(this.getDeviceType())) {
|
|
436
|
+
return true;
|
|
437
|
+
}
|
|
438
|
+
return false;
|
|
413
439
|
}
|
|
414
440
|
getDeviceType() {
|
|
415
441
|
return this.rawStation.device_type;
|
|
@@ -455,14 +481,16 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
455
481
|
if (message.station_current_mode !== undefined)
|
|
456
482
|
this.updateRawProperty(types_2.CommandType.CMD_GET_ALARM_MODE, message.station_current_mode.toString());
|
|
457
483
|
}
|
|
458
|
-
catch (
|
|
459
|
-
|
|
484
|
+
catch (err) {
|
|
485
|
+
const error = (0, error_1.ensureError)(err);
|
|
486
|
+
this.log.debug(`Station ${message.station_sn} MODE_SWITCH event (${message.event_type}) - Error`, error);
|
|
460
487
|
}
|
|
461
488
|
}
|
|
462
489
|
else if (message.event_type === types_3.CusPushEvent.ALARM && message.station_sn === this.getSerial() && !this.isStation()) {
|
|
463
490
|
this.log.info("Received push notification for alarm event", { stationSN: message.station_sn, alarmType: message.alarm_type });
|
|
464
|
-
if (message.alarm_type !== undefined)
|
|
465
|
-
this.
|
|
491
|
+
if (message.alarm_type !== undefined) {
|
|
492
|
+
this.onAlarmEvent(message.alarm_type);
|
|
493
|
+
}
|
|
466
494
|
}
|
|
467
495
|
}
|
|
468
496
|
else if (message.msg_type === types_3.CusPushEvent.TFCARD && message.station_sn === this.getSerial() && message.tfcard_status !== undefined) {
|
|
@@ -520,8 +548,11 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
520
548
|
}
|
|
521
549
|
onParameter(channel, param, value) {
|
|
522
550
|
const params = {};
|
|
523
|
-
|
|
524
|
-
|
|
551
|
+
const parsedValue = parameter_1.ParameterHelper.readValue(param, value, this.log);
|
|
552
|
+
if (parsedValue !== undefined) {
|
|
553
|
+
params[param] = parsedValue;
|
|
554
|
+
this.emit("raw device property changed", this._getDeviceSerial(channel), params);
|
|
555
|
+
}
|
|
525
556
|
}
|
|
526
557
|
onAlarmDelay(alarmDelayEvent, alarmDelay) {
|
|
527
558
|
this.emit("alarm delay event", this, alarmDelayEvent, alarmDelay);
|
|
@@ -593,7 +624,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
593
624
|
value: mode
|
|
594
625
|
};
|
|
595
626
|
if (!this.hasProperty(propertyData.name)) {
|
|
596
|
-
throw new error_1.NotSupportedError(
|
|
627
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
597
628
|
}
|
|
598
629
|
const property = this.getPropertyMetadata(propertyData.name);
|
|
599
630
|
(0, utils_3.validValue)(property, mode);
|
|
@@ -680,7 +711,6 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
680
711
|
await this.getCameraInfo();
|
|
681
712
|
}
|
|
682
713
|
getArmDelay(mode) {
|
|
683
|
-
var _a, _b, _c;
|
|
684
714
|
let propertyName;
|
|
685
715
|
switch (mode) {
|
|
686
716
|
case types_1.AlarmMode.HOME:
|
|
@@ -702,11 +732,12 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
702
732
|
if (propertyName !== undefined && this.hasPropertyValue(propertyName) && this.getPropertyValue(propertyName) !== "") {
|
|
703
733
|
const settings = this.getPropertyValue(propertyName);
|
|
704
734
|
try {
|
|
705
|
-
if (
|
|
735
|
+
if (settings.count_down_arm?.channel_list?.length > 0 && settings.count_down_arm?.delay_time > 0) {
|
|
706
736
|
return settings.count_down_arm.delay_time;
|
|
707
737
|
}
|
|
708
738
|
}
|
|
709
|
-
catch (
|
|
739
|
+
catch (err) {
|
|
740
|
+
const error = (0, error_1.ensureError)(err);
|
|
710
741
|
this.log.debug(`Station ${this.getSerial()} - getArmDelay - Error`, { error: error, mode: mode, propertyName: propertyName, settings: settings });
|
|
711
742
|
}
|
|
712
743
|
}
|
|
@@ -733,7 +764,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
733
764
|
value = Number.parseInt(this.getRawProperty(CommandType.CMD_GET_CUSTOM3_ACTION));
|
|
734
765
|
break;
|
|
735
766
|
}
|
|
736
|
-
} catch (
|
|
767
|
+
} catch (err) {
|
|
768
|
+
const error = ensureError(err);
|
|
737
769
|
this.log.debug(`Station ${this.getSerial()} - getGuardModeActionSetting - Error`, { error: error, mode: mode });
|
|
738
770
|
}
|
|
739
771
|
return value;
|
|
@@ -772,7 +804,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
772
804
|
if (!devices[device_sn]) {
|
|
773
805
|
devices[device_sn] = {};
|
|
774
806
|
}
|
|
775
|
-
|
|
807
|
+
const parsedValue = parameter_1.ParameterHelper.readValue(param.param_type, param.param_value, this.log);
|
|
808
|
+
if (parsedValue !== undefined) {
|
|
809
|
+
devices[device_sn][param.param_type] = parsedValue;
|
|
810
|
+
}
|
|
776
811
|
}
|
|
777
812
|
}
|
|
778
813
|
else {
|
|
@@ -781,7 +816,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
781
816
|
if (!devices[device_sn]) {
|
|
782
817
|
devices[device_sn] = {};
|
|
783
818
|
}
|
|
784
|
-
|
|
819
|
+
const parsedValue = parameter_1.ParameterHelper.readValue(param.param_type, param.param_value, this.log);
|
|
820
|
+
if (parsedValue !== undefined) {
|
|
821
|
+
devices[device_sn][param.param_type] = parsedValue;
|
|
822
|
+
}
|
|
785
823
|
}
|
|
786
824
|
}
|
|
787
825
|
});
|
|
@@ -794,10 +832,9 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
794
832
|
this.emit("command result", this, result);
|
|
795
833
|
}
|
|
796
834
|
onSecondaryCommandResponse(result) {
|
|
797
|
-
var _a, _b;
|
|
798
835
|
this.log.debug("Got p2p secondary command response", { station: this.getSerial(), commandType: result.command_type, channel: result.channel, returnCode: result.return_code, customData: result.customData });
|
|
799
836
|
this.emit("secondary command result", this, result);
|
|
800
|
-
if (result.command_type === types_2.CommandType.CMD_SMARTSAFE_SETTINGS &&
|
|
837
|
+
if (result.command_type === types_2.CommandType.CMD_SMARTSAFE_SETTINGS && result.customData?.command?.name === "deviceVerifyPIN") {
|
|
801
838
|
if (result.return_code === 0) {
|
|
802
839
|
// Verify PIN was successfull for this session
|
|
803
840
|
this.pinVerified = true;
|
|
@@ -826,7 +863,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
826
863
|
}
|
|
827
864
|
onTimeout() {
|
|
828
865
|
this.log.info(`Timeout connecting to station ${this.getSerial()}`);
|
|
829
|
-
this.emit("connection error", this, new error_1.StationConnectTimeoutError());
|
|
866
|
+
this.emit("connection error", this, new error_1.StationConnectTimeoutError("Timeout connecting to station", { context: { station: this.getSerial() } }));
|
|
830
867
|
this.scheduleReconnect();
|
|
831
868
|
}
|
|
832
869
|
getCurrentDelay() {
|
|
@@ -855,7 +892,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
855
892
|
name: types_1.CommandName.StationReboot
|
|
856
893
|
};
|
|
857
894
|
if (!this.hasCommand(types_1.CommandName.StationReboot)) {
|
|
858
|
-
throw new error_1.NotSupportedError(
|
|
895
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { commandName: commandData.name, station: this.getSerial() } });
|
|
859
896
|
}
|
|
860
897
|
this.log.debug(`Sending reboot command to station ${this.getSerial()}`);
|
|
861
898
|
await this.p2pSession.sendCommandWithInt({
|
|
@@ -873,10 +910,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
873
910
|
value: value
|
|
874
911
|
};
|
|
875
912
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
876
|
-
throw new error_1.WrongStationError(
|
|
913
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
877
914
|
}
|
|
878
915
|
if (!device.hasProperty(propertyData.name)) {
|
|
879
|
-
throw new error_1.NotSupportedError(
|
|
916
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
880
917
|
}
|
|
881
918
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
882
919
|
(0, utils_3.validValue)(property, value);
|
|
@@ -901,7 +938,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
901
938
|
property: propertyData
|
|
902
939
|
});
|
|
903
940
|
}
|
|
904
|
-
else if (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 || (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT && !device.isFloodLightT8420X())) {
|
|
941
|
+
else if (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 || (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT && !device.isFloodLightT8420X()) || device.isGarageCamera()) {
|
|
905
942
|
await this.p2pSession.sendCommandWithIntString({
|
|
906
943
|
commandType: types_2.CommandType.CMD_DEV_LED_SWITCH,
|
|
907
944
|
value: value === true ? 1 : 0,
|
|
@@ -960,6 +997,18 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
960
997
|
property: propertyData
|
|
961
998
|
});
|
|
962
999
|
}
|
|
1000
|
+
else if (device.isWallLightCam()) {
|
|
1001
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
1002
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
1003
|
+
value: JSON.stringify({
|
|
1004
|
+
"commandType": types_2.CommandType.CMD_DEV_LED_SWITCH,
|
|
1005
|
+
"data": value === true ? 1 : 0,
|
|
1006
|
+
}),
|
|
1007
|
+
channel: device.getChannel()
|
|
1008
|
+
}, {
|
|
1009
|
+
property: propertyData
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
963
1012
|
else if (device.isSoloCameras()) {
|
|
964
1013
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
965
1014
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
@@ -1025,7 +1074,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1025
1074
|
});
|
|
1026
1075
|
}
|
|
1027
1076
|
else {
|
|
1028
|
-
throw new error_1.NotSupportedError(
|
|
1077
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1029
1078
|
}
|
|
1030
1079
|
}
|
|
1031
1080
|
async setAutoNightVision(device, value) {
|
|
@@ -1034,22 +1083,36 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1034
1083
|
value: value
|
|
1035
1084
|
};
|
|
1036
1085
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1037
|
-
throw new error_1.WrongStationError(
|
|
1086
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1038
1087
|
}
|
|
1039
1088
|
if (!device.hasProperty(propertyData.name)) {
|
|
1040
|
-
throw new error_1.NotSupportedError(
|
|
1089
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1041
1090
|
}
|
|
1042
1091
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1043
1092
|
(0, utils_3.validValue)(property, value);
|
|
1044
1093
|
this.log.debug(`Sending autonightvision command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1094
|
+
if (device.isWallLightCam()) {
|
|
1095
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
1096
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
1097
|
+
value: JSON.stringify({
|
|
1098
|
+
"commandType": types_2.CommandType.CMD_SET_NIGHT_VISION_TYPE,
|
|
1099
|
+
"data": value === true ? 1 : 0,
|
|
1100
|
+
}),
|
|
1101
|
+
channel: device.getChannel()
|
|
1102
|
+
}, {
|
|
1103
|
+
property: propertyData
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
else {
|
|
1107
|
+
await this.p2pSession.sendCommandWithIntString({
|
|
1108
|
+
commandType: types_2.CommandType.CMD_IRCUT_SWITCH,
|
|
1109
|
+
value: value === true ? 1 : 0,
|
|
1110
|
+
valueSub: device.getChannel(),
|
|
1111
|
+
channel: device.getChannel()
|
|
1112
|
+
}, {
|
|
1113
|
+
property: propertyData
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1053
1116
|
}
|
|
1054
1117
|
async setNightVision(device, value) {
|
|
1055
1118
|
const propertyData = {
|
|
@@ -1057,10 +1120,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1057
1120
|
value: value
|
|
1058
1121
|
};
|
|
1059
1122
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1060
|
-
throw new error_1.WrongStationError(
|
|
1123
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1061
1124
|
}
|
|
1062
1125
|
if (!device.hasProperty(propertyData.name)) {
|
|
1063
|
-
throw new error_1.NotSupportedError(
|
|
1126
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1064
1127
|
}
|
|
1065
1128
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1066
1129
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1087,15 +1150,15 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1087
1150
|
value: value
|
|
1088
1151
|
};
|
|
1089
1152
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1090
|
-
throw new error_1.WrongStationError(
|
|
1153
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1091
1154
|
}
|
|
1092
1155
|
if (!device.hasProperty(propertyData.name)) {
|
|
1093
|
-
throw new error_1.NotSupportedError(
|
|
1156
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1094
1157
|
}
|
|
1095
1158
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1096
1159
|
(0, utils_3.validValue)(property, value);
|
|
1097
1160
|
this.log.debug(`Sending motion detection command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
1098
|
-
if (device.isIndoorCamera() || (device.isFloodLight() && device.getDeviceType() !== types_1.DeviceType.FLOODLIGHT) || device.isFloodLightT8420X() || device.isWiredDoorbellT8200X() || device.isStarlight4GLTE()) {
|
|
1161
|
+
if (device.isIndoorCamera() || (device.isFloodLight() && device.getDeviceType() !== types_1.DeviceType.FLOODLIGHT) || device.isFloodLightT8420X() || device.isWiredDoorbellT8200X() || device.isStarlight4GLTE() || device.isGarageCamera()) {
|
|
1099
1162
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
1100
1163
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
1101
1164
|
value: JSON.stringify({
|
|
@@ -1120,16 +1183,19 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1120
1183
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
1121
1184
|
value: JSON.stringify({
|
|
1122
1185
|
"commandType": types_2.CommandType.CMD_INDOOR_DET_SET_MOTION_DETECT_ENABLE,
|
|
1123
|
-
"data":
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1186
|
+
"data": value === true ? 1 : 0,
|
|
1187
|
+
}),
|
|
1188
|
+
channel: device.getChannel()
|
|
1189
|
+
}, {
|
|
1190
|
+
property: propertyData
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
else if (device.isWallLightCam()) {
|
|
1194
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
1195
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
1196
|
+
value: JSON.stringify({
|
|
1197
|
+
"commandType": types_2.CommandType.CMD_INDOOR_DET_SET_MOTION_DETECT_ENABLE,
|
|
1198
|
+
"data": value === true ? 1 : 0,
|
|
1133
1199
|
}),
|
|
1134
1200
|
channel: device.getChannel()
|
|
1135
1201
|
}, {
|
|
@@ -1168,10 +1234,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1168
1234
|
value: value
|
|
1169
1235
|
};
|
|
1170
1236
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1171
|
-
throw new error_1.WrongStationError(
|
|
1237
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1172
1238
|
}
|
|
1173
1239
|
if (!device.hasProperty(propertyData.name)) {
|
|
1174
|
-
throw new error_1.NotSupportedError(
|
|
1240
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1175
1241
|
}
|
|
1176
1242
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1177
1243
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1201,10 +1267,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1201
1267
|
value: value
|
|
1202
1268
|
};
|
|
1203
1269
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1204
|
-
throw new error_1.WrongStationError(
|
|
1270
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1205
1271
|
}
|
|
1206
1272
|
if (!device.hasProperty(propertyData.name)) {
|
|
1207
|
-
throw new error_1.NotSupportedError(
|
|
1273
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1208
1274
|
}
|
|
1209
1275
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1210
1276
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1234,10 +1300,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1234
1300
|
value: value
|
|
1235
1301
|
};
|
|
1236
1302
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1237
|
-
throw new error_1.WrongStationError(
|
|
1303
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1238
1304
|
}
|
|
1239
1305
|
if (!device.hasProperty(propertyData.name)) {
|
|
1240
|
-
throw new error_1.NotSupportedError(
|
|
1306
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1241
1307
|
}
|
|
1242
1308
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1243
1309
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1267,10 +1333,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1267
1333
|
value: value
|
|
1268
1334
|
};
|
|
1269
1335
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1270
|
-
throw new error_1.WrongStationError(
|
|
1336
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1271
1337
|
}
|
|
1272
1338
|
if (!device.hasProperty(propertyData.name)) {
|
|
1273
|
-
throw new error_1.NotSupportedError(
|
|
1339
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1274
1340
|
}
|
|
1275
1341
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1276
1342
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1300,13 +1366,13 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1300
1366
|
value: direction
|
|
1301
1367
|
};
|
|
1302
1368
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1303
|
-
throw new error_1.WrongStationError(
|
|
1369
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
1304
1370
|
}
|
|
1305
1371
|
if (!device.hasCommand(types_1.CommandName.DevicePanAndTilt)) {
|
|
1306
|
-
throw new error_1.NotSupportedError(
|
|
1372
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
1307
1373
|
}
|
|
1308
1374
|
if (!(direction in types_2.PanTiltDirection)) {
|
|
1309
|
-
throw new error_1.InvalidCommandValueError(
|
|
1375
|
+
throw new error_1.InvalidCommandValueError("Invalid value for this command", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
1310
1376
|
}
|
|
1311
1377
|
this.log.debug(`Sending pan and tilt command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${types_2.PanTiltDirection[direction]}`);
|
|
1312
1378
|
if (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423) {
|
|
@@ -1349,10 +1415,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1349
1415
|
value: value
|
|
1350
1416
|
};
|
|
1351
1417
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1352
|
-
throw new error_1.WrongStationError(
|
|
1418
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1353
1419
|
}
|
|
1354
1420
|
if (!device.hasProperty(propertyData.name)) {
|
|
1355
|
-
throw new error_1.NotSupportedError(
|
|
1421
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1356
1422
|
}
|
|
1357
1423
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1358
1424
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1386,8 +1452,22 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1386
1452
|
property: propertyData
|
|
1387
1453
|
});
|
|
1388
1454
|
}
|
|
1455
|
+
else if (device.isWallLightCam()) {
|
|
1456
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
1457
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
1458
|
+
value: JSON.stringify({
|
|
1459
|
+
"commandType": types_2.CommandType.CMD_SET_FLOODLIGHT_MANUAL_SWITCH,
|
|
1460
|
+
"data": {
|
|
1461
|
+
"value": value === true ? 1 : 0,
|
|
1462
|
+
}
|
|
1463
|
+
}),
|
|
1464
|
+
channel: device.getChannel()
|
|
1465
|
+
}, {
|
|
1466
|
+
property: propertyData
|
|
1467
|
+
});
|
|
1468
|
+
}
|
|
1389
1469
|
else {
|
|
1390
|
-
throw new error_1.NotSupportedError(
|
|
1470
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1391
1471
|
}
|
|
1392
1472
|
}
|
|
1393
1473
|
async setMotionDetectionSensitivity(device, value) {
|
|
@@ -1396,15 +1476,15 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1396
1476
|
value: value
|
|
1397
1477
|
};
|
|
1398
1478
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1399
|
-
throw new error_1.WrongStationError(
|
|
1479
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1400
1480
|
}
|
|
1401
1481
|
if (!device.hasProperty(propertyData.name)) {
|
|
1402
|
-
throw new error_1.NotSupportedError(
|
|
1482
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1403
1483
|
}
|
|
1404
1484
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1405
1485
|
(0, utils_3.validValue)(property, value);
|
|
1406
1486
|
this.log.debug(`Sending motion detection sensitivity command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
1407
|
-
if ((device.isFloodLight() && device.getDeviceType() !== types_1.DeviceType.FLOODLIGHT) || device.isIndoorCamera() || device.isFloodLightT8420X()) {
|
|
1487
|
+
if ((device.isFloodLight() && device.getDeviceType() !== types_1.DeviceType.FLOODLIGHT) || device.isIndoorCamera() || device.isFloodLightT8420X() || device.isGarageCamera()) {
|
|
1408
1488
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
1409
1489
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
1410
1490
|
value: JSON.stringify({
|
|
@@ -1438,6 +1518,18 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1438
1518
|
property: propertyData
|
|
1439
1519
|
});
|
|
1440
1520
|
}
|
|
1521
|
+
else if (device.isWallLightCam()) {
|
|
1522
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
1523
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
1524
|
+
value: JSON.stringify({
|
|
1525
|
+
"commandType": types_2.CommandType.CMD_SET_MOTION_SENSITIVITY,
|
|
1526
|
+
"data": value,
|
|
1527
|
+
}),
|
|
1528
|
+
channel: device.getChannel()
|
|
1529
|
+
}, {
|
|
1530
|
+
property: propertyData
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1441
1533
|
else if ((device.isBatteryDoorbell() && !device.isBatteryDoorbellDual()) || device.isWiredDoorbellDual()) {
|
|
1442
1534
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
1443
1535
|
commandType: types_2.CommandType.CMD_SET_PAYLOAD,
|
|
@@ -1570,7 +1662,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1570
1662
|
});
|
|
1571
1663
|
}
|
|
1572
1664
|
else {
|
|
1573
|
-
throw new error_1.NotSupportedError(
|
|
1665
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1574
1666
|
}
|
|
1575
1667
|
}
|
|
1576
1668
|
async setMotionDetectionType(device, value) {
|
|
@@ -1579,17 +1671,17 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1579
1671
|
value: value
|
|
1580
1672
|
};
|
|
1581
1673
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1582
|
-
throw new error_1.WrongStationError(
|
|
1674
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1583
1675
|
}
|
|
1584
1676
|
if (!device.hasProperty(propertyData.name)) {
|
|
1585
|
-
throw new error_1.NotSupportedError(
|
|
1677
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1586
1678
|
}
|
|
1587
1679
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1588
1680
|
(0, utils_3.validValue)(property, value);
|
|
1589
1681
|
this.log.debug(`Sending motion detection type command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
1590
1682
|
if (device.isCamera2Product() || device.isBatteryDoorbell() || device.getDeviceType() === types_1.DeviceType.CAMERA ||
|
|
1591
1683
|
device.getDeviceType() === types_1.DeviceType.CAMERA_E || device.isSoloCameras() ||
|
|
1592
|
-
device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 || device.isWiredDoorbellDual() || device.isStarlight4GLTE()) {
|
|
1684
|
+
device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 || device.isWiredDoorbellDual() || device.isStarlight4GLTE() || device.isGarageCamera()) {
|
|
1593
1685
|
await this.p2pSession.sendCommandWithInt({
|
|
1594
1686
|
commandType: types_2.CommandType.CMD_DEV_PUSHMSG_MODE,
|
|
1595
1687
|
value: value,
|
|
@@ -1634,7 +1726,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1634
1726
|
});
|
|
1635
1727
|
}
|
|
1636
1728
|
else {
|
|
1637
|
-
throw new error_1.NotSupportedError(
|
|
1729
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1638
1730
|
}
|
|
1639
1731
|
}
|
|
1640
1732
|
async setMotionDetectionTypeHB3(device, type, value) {
|
|
@@ -1643,10 +1735,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1643
1735
|
value: value
|
|
1644
1736
|
};
|
|
1645
1737
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1646
|
-
throw new error_1.WrongStationError(
|
|
1738
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1647
1739
|
}
|
|
1648
1740
|
if (!device.hasProperty(propertyData.name)) {
|
|
1649
|
-
throw new error_1.NotSupportedError(
|
|
1741
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1650
1742
|
}
|
|
1651
1743
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1652
1744
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1669,7 +1761,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1669
1761
|
property: propertyData
|
|
1670
1762
|
});
|
|
1671
1763
|
}
|
|
1672
|
-
catch (
|
|
1764
|
+
catch (err) {
|
|
1765
|
+
const error = (0, error_1.ensureError)(err);
|
|
1673
1766
|
this.log.error(`setMotionDetectionTypeHB3 - station ${this.getSerial()} device ${device.getSerial()}`, error);
|
|
1674
1767
|
}
|
|
1675
1768
|
}
|
|
@@ -1679,10 +1772,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1679
1772
|
value: value
|
|
1680
1773
|
};
|
|
1681
1774
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1682
|
-
throw new error_1.WrongStationError(
|
|
1775
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1683
1776
|
}
|
|
1684
1777
|
if (!device.hasProperty(propertyData.name)) {
|
|
1685
|
-
throw new error_1.NotSupportedError(
|
|
1778
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1686
1779
|
}
|
|
1687
1780
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1688
1781
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1704,10 +1797,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1704
1797
|
value: value
|
|
1705
1798
|
};
|
|
1706
1799
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1707
|
-
throw new error_1.WrongStationError(
|
|
1800
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1708
1801
|
}
|
|
1709
1802
|
if (!device.hasProperty(propertyData.name)) {
|
|
1710
|
-
throw new error_1.NotSupportedError(
|
|
1803
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1711
1804
|
}
|
|
1712
1805
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1713
1806
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1738,10 +1831,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1738
1831
|
value: value
|
|
1739
1832
|
};
|
|
1740
1833
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1741
|
-
throw new error_1.WrongStationError(
|
|
1834
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1742
1835
|
}
|
|
1743
1836
|
if (!device.hasProperty(propertyData.name)) {
|
|
1744
|
-
throw new error_1.NotSupportedError(
|
|
1837
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1745
1838
|
}
|
|
1746
1839
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1747
1840
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1772,10 +1865,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1772
1865
|
value: value
|
|
1773
1866
|
};
|
|
1774
1867
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1775
|
-
throw new error_1.WrongStationError(
|
|
1868
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1776
1869
|
}
|
|
1777
1870
|
if (!device.hasProperty(propertyData.name)) {
|
|
1778
|
-
throw new error_1.NotSupportedError(
|
|
1871
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1779
1872
|
}
|
|
1780
1873
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1781
1874
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1796,15 +1889,15 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1796
1889
|
value: value
|
|
1797
1890
|
};
|
|
1798
1891
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1799
|
-
throw new error_1.WrongStationError(
|
|
1892
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1800
1893
|
}
|
|
1801
1894
|
if (!device.hasProperty(propertyData.name)) {
|
|
1802
|
-
throw new error_1.NotSupportedError(
|
|
1895
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1803
1896
|
}
|
|
1804
1897
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1805
1898
|
(0, utils_3.validValue)(property, value);
|
|
1806
1899
|
this.log.debug(`Sending audio recording command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
1807
|
-
if (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423) {
|
|
1900
|
+
if (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 || device.isGarageCamera()) {
|
|
1808
1901
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
1809
1902
|
commandType: types_2.CommandType.CMD_SET_PAYLOAD,
|
|
1810
1903
|
value: JSON.stringify({
|
|
@@ -1864,6 +1957,18 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1864
1957
|
property: propertyData
|
|
1865
1958
|
});
|
|
1866
1959
|
}
|
|
1960
|
+
else if (device.isWallLightCam()) {
|
|
1961
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
1962
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
1963
|
+
value: JSON.stringify({
|
|
1964
|
+
"commandType": types_2.CommandType.CMD_SET_AUDIO_MUTE_RECORD,
|
|
1965
|
+
"data": value === true ? 1 : 0,
|
|
1966
|
+
}),
|
|
1967
|
+
channel: device.getChannel()
|
|
1968
|
+
}, {
|
|
1969
|
+
property: propertyData
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1867
1972
|
else if (device.isCamera2Product() || device.isCamera3Product() || device.isBatteryDoorbell() || device.getDeviceType() === types_1.DeviceType.CAMERA || device.getDeviceType() === types_1.DeviceType.CAMERA_E || device.isWiredDoorbellDual()) {
|
|
1868
1973
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
1869
1974
|
commandType: types_2.CommandType.CMD_SET_PAYLOAD,
|
|
@@ -1910,7 +2015,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1910
2015
|
});
|
|
1911
2016
|
}
|
|
1912
2017
|
else {
|
|
1913
|
-
throw new error_1.NotSupportedError(
|
|
2018
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1914
2019
|
}
|
|
1915
2020
|
}
|
|
1916
2021
|
async enableSpeaker(device, value) {
|
|
@@ -1919,10 +2024,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1919
2024
|
value: value
|
|
1920
2025
|
};
|
|
1921
2026
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1922
|
-
throw new error_1.WrongStationError(
|
|
2027
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1923
2028
|
}
|
|
1924
2029
|
if (!device.hasProperty(propertyData.name)) {
|
|
1925
|
-
throw new error_1.NotSupportedError(
|
|
2030
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1926
2031
|
}
|
|
1927
2032
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1928
2033
|
(0, utils_3.validValue)(property, value);
|
|
@@ -1943,23 +2048,37 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1943
2048
|
value: value
|
|
1944
2049
|
};
|
|
1945
2050
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1946
|
-
throw new error_1.WrongStationError(
|
|
2051
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1947
2052
|
}
|
|
1948
2053
|
if (!device.hasProperty(propertyData.name)) {
|
|
1949
|
-
throw new error_1.NotSupportedError(
|
|
2054
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1950
2055
|
}
|
|
1951
2056
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1952
2057
|
(0, utils_3.validValue)(property, value);
|
|
1953
2058
|
this.log.debug(`Sending speaker volume command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
2059
|
+
if (device.isWallLightCam()) {
|
|
2060
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
2061
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2062
|
+
value: JSON.stringify({
|
|
2063
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SPEAKER_VOLUME,
|
|
2064
|
+
"data": value
|
|
2065
|
+
}),
|
|
2066
|
+
channel: device.getChannel()
|
|
2067
|
+
}, {
|
|
2068
|
+
property: propertyData
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
else {
|
|
2072
|
+
await this.p2pSession.sendCommandWithIntString({
|
|
2073
|
+
commandType: types_2.CommandType.CMD_SET_DEV_SPEAKER_VOLUME,
|
|
2074
|
+
value: value,
|
|
2075
|
+
valueSub: device.getChannel(),
|
|
2076
|
+
strValue: this.rawStation.member.admin_user_id,
|
|
2077
|
+
channel: device.getChannel()
|
|
2078
|
+
}, {
|
|
2079
|
+
property: propertyData
|
|
2080
|
+
});
|
|
2081
|
+
}
|
|
1963
2082
|
}
|
|
1964
2083
|
async setRingtoneVolume(device, value) {
|
|
1965
2084
|
const propertyData = {
|
|
@@ -1967,10 +2086,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1967
2086
|
value: value
|
|
1968
2087
|
};
|
|
1969
2088
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
1970
|
-
throw new error_1.WrongStationError(
|
|
2089
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1971
2090
|
}
|
|
1972
2091
|
if (!device.hasProperty(propertyData.name)) {
|
|
1973
|
-
throw new error_1.NotSupportedError(
|
|
2092
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
1974
2093
|
}
|
|
1975
2094
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
1976
2095
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2015,7 +2134,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2015
2134
|
});
|
|
2016
2135
|
}
|
|
2017
2136
|
else {
|
|
2018
|
-
throw new error_1.NotSupportedError(
|
|
2137
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2019
2138
|
}
|
|
2020
2139
|
}
|
|
2021
2140
|
async enableIndoorChime(device, value) {
|
|
@@ -2024,10 +2143,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2024
2143
|
value: value
|
|
2025
2144
|
};
|
|
2026
2145
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2027
|
-
throw new error_1.WrongStationError(
|
|
2146
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2028
2147
|
}
|
|
2029
2148
|
if (!device.hasProperty(propertyData.name)) {
|
|
2030
|
-
throw new error_1.NotSupportedError(
|
|
2149
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2031
2150
|
}
|
|
2032
2151
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2033
2152
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2058,7 +2177,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2058
2177
|
});
|
|
2059
2178
|
}
|
|
2060
2179
|
else {
|
|
2061
|
-
throw new error_1.NotSupportedError(
|
|
2180
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2062
2181
|
}
|
|
2063
2182
|
}
|
|
2064
2183
|
async enableHomebaseChime(device, value) {
|
|
@@ -2067,10 +2186,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2067
2186
|
value: value
|
|
2068
2187
|
};
|
|
2069
2188
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2070
|
-
throw new error_1.WrongStationError(
|
|
2189
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2071
2190
|
}
|
|
2072
2191
|
if (!device.hasProperty(propertyData.name)) {
|
|
2073
|
-
throw new error_1.NotSupportedError(
|
|
2192
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2074
2193
|
}
|
|
2075
2194
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2076
2195
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2087,7 +2206,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2087
2206
|
});
|
|
2088
2207
|
}
|
|
2089
2208
|
else {
|
|
2090
|
-
throw new error_1.NotSupportedError(
|
|
2209
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2091
2210
|
}
|
|
2092
2211
|
}
|
|
2093
2212
|
async setHomebaseChimeRingtoneVolume(device, value) {
|
|
@@ -2096,10 +2215,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2096
2215
|
value: value
|
|
2097
2216
|
};
|
|
2098
2217
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2099
|
-
throw new error_1.WrongStationError(
|
|
2218
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2100
2219
|
}
|
|
2101
2220
|
if (!device.hasProperty(propertyData.name)) {
|
|
2102
|
-
throw new error_1.NotSupportedError(
|
|
2221
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2103
2222
|
}
|
|
2104
2223
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2105
2224
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2121,7 +2240,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2121
2240
|
});
|
|
2122
2241
|
}
|
|
2123
2242
|
else {
|
|
2124
|
-
throw new error_1.NotSupportedError(
|
|
2243
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2125
2244
|
}
|
|
2126
2245
|
}
|
|
2127
2246
|
async setHomebaseChimeRingtoneType(device, value) {
|
|
@@ -2130,10 +2249,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2130
2249
|
value: value
|
|
2131
2250
|
};
|
|
2132
2251
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2133
|
-
throw new error_1.WrongStationError(
|
|
2252
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2134
2253
|
}
|
|
2135
2254
|
if (!device.hasProperty(propertyData.name)) {
|
|
2136
|
-
throw new error_1.NotSupportedError(
|
|
2255
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2137
2256
|
}
|
|
2138
2257
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2139
2258
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2155,7 +2274,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2155
2274
|
});
|
|
2156
2275
|
}
|
|
2157
2276
|
else {
|
|
2158
|
-
throw new error_1.NotSupportedError(
|
|
2277
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2159
2278
|
}
|
|
2160
2279
|
}
|
|
2161
2280
|
async setNotificationType(device, value) {
|
|
@@ -2164,15 +2283,19 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2164
2283
|
value: value
|
|
2165
2284
|
};
|
|
2166
2285
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2167
|
-
throw new error_1.WrongStationError(
|
|
2286
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2168
2287
|
}
|
|
2169
2288
|
if (!device.hasProperty(propertyData.name)) {
|
|
2170
|
-
throw new error_1.NotSupportedError(
|
|
2289
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2171
2290
|
}
|
|
2172
2291
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2173
2292
|
(0, utils_3.validValue)(property, value);
|
|
2174
2293
|
this.log.debug(`Sending notification type command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
2175
|
-
if (device.isFloodLight() || device.isIndoorCamera() || device.isSoloCameras() || device.isStarlight4GLTE()) {
|
|
2294
|
+
if (device.isFloodLight() || device.isIndoorCamera() || device.isSoloCameras() || device.isStarlight4GLTE() || device.isGarageCamera()) {
|
|
2295
|
+
if (!Object.values(types_1.NotificationType).includes(value)) {
|
|
2296
|
+
this.log.error(`The device ${device.getSerial()} accepts only this type of values:`, types_1.NotificationType);
|
|
2297
|
+
return;
|
|
2298
|
+
}
|
|
2176
2299
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
2177
2300
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2178
2301
|
value: JSON.stringify({
|
|
@@ -2194,6 +2317,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2194
2317
|
});
|
|
2195
2318
|
}
|
|
2196
2319
|
else if (device.isWiredDoorbellT8200X()) {
|
|
2320
|
+
if (!Object.values(types_1.NotificationType).includes(value)) {
|
|
2321
|
+
this.log.error(`The device ${device.getSerial()} accepts only this type of values:`, types_1.NotificationType);
|
|
2322
|
+
return;
|
|
2323
|
+
}
|
|
2197
2324
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
2198
2325
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2199
2326
|
value: JSON.stringify({
|
|
@@ -2207,7 +2334,27 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2207
2334
|
property: propertyData
|
|
2208
2335
|
});
|
|
2209
2336
|
}
|
|
2337
|
+
else if (device.isWallLightCam()) {
|
|
2338
|
+
if (!Object.values(types_1.WalllightNotificationType).includes(value)) {
|
|
2339
|
+
this.log.error(`The device ${device.getSerial()} accepts only this type of values:`, types_1.WalllightNotificationType);
|
|
2340
|
+
return;
|
|
2341
|
+
}
|
|
2342
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
2343
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2344
|
+
value: JSON.stringify({
|
|
2345
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_NOTIFICATION_TYPE,
|
|
2346
|
+
"data": value,
|
|
2347
|
+
}),
|
|
2348
|
+
channel: device.getChannel()
|
|
2349
|
+
}, {
|
|
2350
|
+
property: propertyData
|
|
2351
|
+
});
|
|
2352
|
+
}
|
|
2210
2353
|
else if (device.isBatteryDoorbell() || device.isWiredDoorbellDual()) {
|
|
2354
|
+
if (!Object.values(types_1.NotificationType).includes(value)) {
|
|
2355
|
+
this.log.error(`The device ${device.getSerial()} accepts only this type of values:`, types_1.NotificationType);
|
|
2356
|
+
return;
|
|
2357
|
+
}
|
|
2211
2358
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
2212
2359
|
commandType: types_2.CommandType.CMD_SET_PAYLOAD,
|
|
2213
2360
|
value: JSON.stringify({
|
|
@@ -2226,6 +2373,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2226
2373
|
});
|
|
2227
2374
|
}
|
|
2228
2375
|
else if (device.isCamera2Product() || device.getDeviceType() === types_1.DeviceType.CAMERA || device.getDeviceType() === types_1.DeviceType.CAMERA_E || device.isCamera3Product()) {
|
|
2376
|
+
if (!Object.values(types_1.NotificationType).includes(value)) {
|
|
2377
|
+
this.log.error(`The device ${device.getSerial()} accepts only this type of values:`, types_1.NotificationType);
|
|
2378
|
+
return;
|
|
2379
|
+
}
|
|
2229
2380
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
2230
2381
|
commandType: types_2.CommandType.CMD_SET_PAYLOAD,
|
|
2231
2382
|
value: JSON.stringify({
|
|
@@ -2242,6 +2393,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2242
2393
|
});
|
|
2243
2394
|
}
|
|
2244
2395
|
else if (device.isWiredDoorbell()) {
|
|
2396
|
+
if (!Object.values(types_1.NotificationType).includes(value)) {
|
|
2397
|
+
this.log.error(`The device ${device.getSerial()} accepts only this type of values:`, types_1.NotificationType);
|
|
2398
|
+
return;
|
|
2399
|
+
}
|
|
2245
2400
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
2246
2401
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2247
2402
|
value: JSON.stringify({
|
|
@@ -2256,7 +2411,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2256
2411
|
});
|
|
2257
2412
|
}
|
|
2258
2413
|
else {
|
|
2259
|
-
throw new error_1.NotSupportedError(
|
|
2414
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2260
2415
|
}
|
|
2261
2416
|
}
|
|
2262
2417
|
async setNotificationPerson(device, value) {
|
|
@@ -2265,15 +2420,15 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2265
2420
|
value: value
|
|
2266
2421
|
};
|
|
2267
2422
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2268
|
-
throw new error_1.WrongStationError(
|
|
2423
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2269
2424
|
}
|
|
2270
2425
|
if (!device.hasProperty(propertyData.name)) {
|
|
2271
|
-
throw new error_1.NotSupportedError(
|
|
2426
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2272
2427
|
}
|
|
2273
2428
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2274
2429
|
(0, utils_3.validValue)(property, value);
|
|
2275
2430
|
this.log.debug(`Sending notification person command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
2276
|
-
if (device.isIndoorCamera()) {
|
|
2431
|
+
if (device.isIndoorCamera() || device.isGarageCamera()) {
|
|
2277
2432
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
2278
2433
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2279
2434
|
value: JSON.stringify({
|
|
@@ -2294,8 +2449,20 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2294
2449
|
property: propertyData
|
|
2295
2450
|
});
|
|
2296
2451
|
}
|
|
2452
|
+
else if (device.isWallLightCam()) {
|
|
2453
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
2454
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2455
|
+
value: JSON.stringify({
|
|
2456
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_NOTIFICATION_TYPE_HUMAN,
|
|
2457
|
+
"data": value === true ? 1 : 0,
|
|
2458
|
+
}),
|
|
2459
|
+
channel: device.getChannel()
|
|
2460
|
+
}, {
|
|
2461
|
+
property: propertyData
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2297
2464
|
else {
|
|
2298
|
-
throw new error_1.NotSupportedError(
|
|
2465
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2299
2466
|
}
|
|
2300
2467
|
}
|
|
2301
2468
|
async setNotificationPet(device, value) {
|
|
@@ -2304,10 +2471,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2304
2471
|
value: value
|
|
2305
2472
|
};
|
|
2306
2473
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2307
|
-
throw new error_1.WrongStationError(
|
|
2474
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2308
2475
|
}
|
|
2309
2476
|
if (!device.hasProperty(propertyData.name)) {
|
|
2310
|
-
throw new error_1.NotSupportedError(
|
|
2477
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2311
2478
|
}
|
|
2312
2479
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2313
2480
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2334,7 +2501,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2334
2501
|
});
|
|
2335
2502
|
}
|
|
2336
2503
|
else {
|
|
2337
|
-
throw new error_1.NotSupportedError(
|
|
2504
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2338
2505
|
}
|
|
2339
2506
|
}
|
|
2340
2507
|
async setNotificationAllOtherMotion(device, value) {
|
|
@@ -2343,15 +2510,15 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2343
2510
|
value: value
|
|
2344
2511
|
};
|
|
2345
2512
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2346
|
-
throw new error_1.WrongStationError(
|
|
2513
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2347
2514
|
}
|
|
2348
2515
|
if (!device.hasProperty(propertyData.name)) {
|
|
2349
|
-
throw new error_1.NotSupportedError(
|
|
2516
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2350
2517
|
}
|
|
2351
2518
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2352
2519
|
(0, utils_3.validValue)(property, value);
|
|
2353
2520
|
this.log.debug(`Sending notification all other motion command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
2354
|
-
if (device.isIndoorCamera()) {
|
|
2521
|
+
if (device.isIndoorCamera() || device.isGarageCamera()) {
|
|
2355
2522
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
2356
2523
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2357
2524
|
value: JSON.stringify({
|
|
@@ -2372,8 +2539,20 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2372
2539
|
property: propertyData
|
|
2373
2540
|
});
|
|
2374
2541
|
}
|
|
2542
|
+
else if (device.isWallLightCam()) {
|
|
2543
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
2544
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2545
|
+
value: JSON.stringify({
|
|
2546
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_NOTIFICATION_TYPE_ALL,
|
|
2547
|
+
"data": value === true ? 1 : 0,
|
|
2548
|
+
}),
|
|
2549
|
+
channel: device.getChannel()
|
|
2550
|
+
}, {
|
|
2551
|
+
property: propertyData
|
|
2552
|
+
});
|
|
2553
|
+
}
|
|
2375
2554
|
else {
|
|
2376
|
-
throw new error_1.NotSupportedError(
|
|
2555
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2377
2556
|
}
|
|
2378
2557
|
}
|
|
2379
2558
|
async setNotificationAllSound(device, value) {
|
|
@@ -2382,10 +2561,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2382
2561
|
value: value
|
|
2383
2562
|
};
|
|
2384
2563
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2385
|
-
throw new error_1.WrongStationError(
|
|
2564
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2386
2565
|
}
|
|
2387
2566
|
if (!device.hasProperty(propertyData.name)) {
|
|
2388
|
-
throw new error_1.NotSupportedError(
|
|
2567
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2389
2568
|
}
|
|
2390
2569
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2391
2570
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2412,7 +2591,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2412
2591
|
});
|
|
2413
2592
|
}
|
|
2414
2593
|
else {
|
|
2415
|
-
throw new error_1.NotSupportedError(
|
|
2594
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2416
2595
|
}
|
|
2417
2596
|
}
|
|
2418
2597
|
async setNotificationCrying(device, value) {
|
|
@@ -2421,10 +2600,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2421
2600
|
value: value
|
|
2422
2601
|
};
|
|
2423
2602
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2424
|
-
throw new error_1.WrongStationError(
|
|
2603
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2425
2604
|
}
|
|
2426
2605
|
if (!device.hasProperty(propertyData.name)) {
|
|
2427
|
-
throw new error_1.NotSupportedError(
|
|
2606
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2428
2607
|
}
|
|
2429
2608
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2430
2609
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2451,7 +2630,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2451
2630
|
});
|
|
2452
2631
|
}
|
|
2453
2632
|
else {
|
|
2454
|
-
throw new error_1.NotSupportedError(
|
|
2633
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2455
2634
|
}
|
|
2456
2635
|
}
|
|
2457
2636
|
async setNotificationRing(device, value) {
|
|
@@ -2460,10 +2639,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2460
2639
|
value: value
|
|
2461
2640
|
};
|
|
2462
2641
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2463
|
-
throw new error_1.WrongStationError(
|
|
2642
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2464
2643
|
}
|
|
2465
2644
|
if (!device.hasProperty(propertyData.name)) {
|
|
2466
|
-
throw new error_1.NotSupportedError(
|
|
2645
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2467
2646
|
}
|
|
2468
2647
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2469
2648
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2501,7 +2680,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2501
2680
|
});
|
|
2502
2681
|
}
|
|
2503
2682
|
else {
|
|
2504
|
-
throw new error_1.NotSupportedError(
|
|
2683
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2505
2684
|
}
|
|
2506
2685
|
}
|
|
2507
2686
|
async setNotificationMotion(device, value) {
|
|
@@ -2510,10 +2689,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2510
2689
|
value: value
|
|
2511
2690
|
};
|
|
2512
2691
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2513
|
-
throw new error_1.WrongStationError(
|
|
2692
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2514
2693
|
}
|
|
2515
2694
|
if (!device.hasProperty(propertyData.name)) {
|
|
2516
|
-
throw new error_1.NotSupportedError(
|
|
2695
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2517
2696
|
}
|
|
2518
2697
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2519
2698
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2551,7 +2730,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2551
2730
|
});
|
|
2552
2731
|
}
|
|
2553
2732
|
else {
|
|
2554
|
-
throw new error_1.NotSupportedError(
|
|
2733
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2555
2734
|
}
|
|
2556
2735
|
}
|
|
2557
2736
|
async setPowerSource(device, value) {
|
|
@@ -2560,10 +2739,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2560
2739
|
value: value
|
|
2561
2740
|
};
|
|
2562
2741
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2563
|
-
throw new error_1.WrongStationError(
|
|
2742
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2564
2743
|
}
|
|
2565
2744
|
if (!device.hasProperty(propertyData.name)) {
|
|
2566
|
-
throw new error_1.NotSupportedError(
|
|
2745
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2567
2746
|
}
|
|
2568
2747
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2569
2748
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2605,10 +2784,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2605
2784
|
value: value
|
|
2606
2785
|
};
|
|
2607
2786
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2608
|
-
throw new error_1.WrongStationError(
|
|
2787
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2609
2788
|
}
|
|
2610
2789
|
if (!device.hasProperty(propertyData.name)) {
|
|
2611
|
-
throw new error_1.NotSupportedError(
|
|
2790
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2612
2791
|
}
|
|
2613
2792
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2614
2793
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2629,10 +2808,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2629
2808
|
value: value
|
|
2630
2809
|
};
|
|
2631
2810
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2632
|
-
throw new error_1.WrongStationError(
|
|
2811
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2633
2812
|
}
|
|
2634
2813
|
if (!device.hasProperty(propertyData.name)) {
|
|
2635
|
-
throw new error_1.NotSupportedError(
|
|
2814
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2636
2815
|
}
|
|
2637
2816
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2638
2817
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2652,10 +2831,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2652
2831
|
value: value
|
|
2653
2832
|
};
|
|
2654
2833
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2655
|
-
throw new error_1.WrongStationError(
|
|
2834
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2656
2835
|
}
|
|
2657
2836
|
if (!device.hasProperty(propertyData.name)) {
|
|
2658
|
-
throw new error_1.NotSupportedError(
|
|
2837
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2659
2838
|
}
|
|
2660
2839
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2661
2840
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2675,10 +2854,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2675
2854
|
value: value
|
|
2676
2855
|
};
|
|
2677
2856
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2678
|
-
throw new error_1.WrongStationError(
|
|
2857
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2679
2858
|
}
|
|
2680
2859
|
if (!device.hasProperty(propertyData.name)) {
|
|
2681
|
-
throw new error_1.NotSupportedError(
|
|
2860
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2682
2861
|
}
|
|
2683
2862
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2684
2863
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2698,15 +2877,15 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2698
2877
|
value: value
|
|
2699
2878
|
};
|
|
2700
2879
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2701
|
-
throw new error_1.WrongStationError(
|
|
2880
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2702
2881
|
}
|
|
2703
2882
|
if (!device.hasProperty(propertyData.name)) {
|
|
2704
|
-
throw new error_1.NotSupportedError(
|
|
2883
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2705
2884
|
}
|
|
2706
2885
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2707
2886
|
(0, utils_3.validValue)(property, value);
|
|
2708
2887
|
this.log.debug(`Sending video streaming quality command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
2709
|
-
if (device.isIndoorCamera() || device.isSoloCameras() || device.isFloodLight() || device.isWiredDoorbell() || device.isStarlight4GLTE()) {
|
|
2888
|
+
if (device.isIndoorCamera() || device.isSoloCameras() || device.isFloodLight() || device.isWiredDoorbell() || device.isStarlight4GLTE() || device.isGarageCamera()) {
|
|
2710
2889
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
2711
2890
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2712
2891
|
value: JSON.stringify({
|
|
@@ -2720,6 +2899,18 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2720
2899
|
property: propertyData
|
|
2721
2900
|
});
|
|
2722
2901
|
}
|
|
2902
|
+
else if (device.isWallLightCam()) {
|
|
2903
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
2904
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2905
|
+
value: JSON.stringify({
|
|
2906
|
+
"commandType": types_2.CommandType.CMD_SET_RESOLUTION,
|
|
2907
|
+
"data": value,
|
|
2908
|
+
}),
|
|
2909
|
+
channel: device.getChannel()
|
|
2910
|
+
}, {
|
|
2911
|
+
property: propertyData
|
|
2912
|
+
});
|
|
2913
|
+
}
|
|
2723
2914
|
else if (device.isBatteryDoorbell() || device.isCamera2CPro() || device.isWiredDoorbellDual() || device.isCamera3() || device.isCamera3C()) {
|
|
2724
2915
|
await this.p2pSession.sendCommandWithIntString({
|
|
2725
2916
|
commandType: types_2.CommandType.CMD_BAT_DOORBELL_VIDEO_QUALITY,
|
|
@@ -2732,7 +2923,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2732
2923
|
});
|
|
2733
2924
|
}
|
|
2734
2925
|
else {
|
|
2735
|
-
throw new error_1.NotSupportedError(
|
|
2926
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2736
2927
|
}
|
|
2737
2928
|
}
|
|
2738
2929
|
async setVideoRecordingQuality(device, value) {
|
|
@@ -2741,15 +2932,15 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2741
2932
|
value: value
|
|
2742
2933
|
};
|
|
2743
2934
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2744
|
-
throw new error_1.WrongStationError(
|
|
2935
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2745
2936
|
}
|
|
2746
2937
|
if (!device.hasProperty(propertyData.name)) {
|
|
2747
|
-
throw new error_1.NotSupportedError(
|
|
2938
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2748
2939
|
}
|
|
2749
2940
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2750
2941
|
(0, utils_3.validValue)(property, value);
|
|
2751
2942
|
this.log.debug(`Sending video recording quality command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
2752
|
-
if (device.isIndoorCamera() || device.isWiredDoorbell() || device.isFloodLight() || device.isSoloCameras() || device.isStarlight4GLTE()) {
|
|
2943
|
+
if (device.isIndoorCamera() || device.isWiredDoorbell() || device.isFloodLight() || device.isSoloCameras() || device.isStarlight4GLTE() || device.isGarageCamera()) {
|
|
2753
2944
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
2754
2945
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2755
2946
|
value: JSON.stringify({
|
|
@@ -2763,6 +2954,18 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2763
2954
|
property: propertyData
|
|
2764
2955
|
});
|
|
2765
2956
|
}
|
|
2957
|
+
else if (device.isWallLightCam()) {
|
|
2958
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
2959
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
2960
|
+
value: JSON.stringify({
|
|
2961
|
+
"commandType": types_2.CommandType.CMD_SET_RECORD_QUALITY,
|
|
2962
|
+
"data": value,
|
|
2963
|
+
}),
|
|
2964
|
+
channel: device.getChannel()
|
|
2965
|
+
}, {
|
|
2966
|
+
property: propertyData
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2766
2969
|
else if (device.isCamera2CPro() || device.isCamera3() || device.isCamera3C()) {
|
|
2767
2970
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
2768
2971
|
commandType: types_2.CommandType.CMD_SET_PAYLOAD,
|
|
@@ -2780,7 +2983,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2780
2983
|
});
|
|
2781
2984
|
}
|
|
2782
2985
|
else {
|
|
2783
|
-
throw new error_1.NotSupportedError(
|
|
2986
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2784
2987
|
}
|
|
2785
2988
|
}
|
|
2786
2989
|
async setWDR(device, value) {
|
|
@@ -2789,10 +2992,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2789
2992
|
value: value
|
|
2790
2993
|
};
|
|
2791
2994
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2792
|
-
throw new error_1.WrongStationError(
|
|
2995
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2793
2996
|
}
|
|
2794
2997
|
if (!device.hasProperty(propertyData.name)) {
|
|
2795
|
-
throw new error_1.NotSupportedError(
|
|
2998
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2796
2999
|
}
|
|
2797
3000
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2798
3001
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2813,10 +3016,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2813
3016
|
value: value
|
|
2814
3017
|
};
|
|
2815
3018
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2816
|
-
throw new error_1.WrongStationError(
|
|
3019
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2817
3020
|
}
|
|
2818
3021
|
if (!device.hasProperty(propertyData.name)) {
|
|
2819
|
-
throw new error_1.NotSupportedError(
|
|
3022
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2820
3023
|
}
|
|
2821
3024
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2822
3025
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2837,10 +3040,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2837
3040
|
value: value
|
|
2838
3041
|
};
|
|
2839
3042
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2840
|
-
throw new error_1.WrongStationError(
|
|
3043
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2841
3044
|
}
|
|
2842
3045
|
if (!device.hasProperty(propertyData.name)) {
|
|
2843
|
-
throw new error_1.NotSupportedError(
|
|
3046
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2844
3047
|
}
|
|
2845
3048
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2846
3049
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2858,8 +3061,23 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2858
3061
|
property: propertyData
|
|
2859
3062
|
});
|
|
2860
3063
|
}
|
|
3064
|
+
else if (device.isWallLightCam()) {
|
|
3065
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
3066
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
3067
|
+
value: JSON.stringify({
|
|
3068
|
+
"commandType": types_2.CommandType.CMD_SET_FLOODLIGHT_BRIGHT_VALUE,
|
|
3069
|
+
"data": {
|
|
3070
|
+
"type": 0,
|
|
3071
|
+
"value": value,
|
|
3072
|
+
},
|
|
3073
|
+
}),
|
|
3074
|
+
channel: device.getChannel()
|
|
3075
|
+
}, {
|
|
3076
|
+
property: propertyData
|
|
3077
|
+
});
|
|
3078
|
+
}
|
|
2861
3079
|
else {
|
|
2862
|
-
throw new error_1.NotSupportedError(
|
|
3080
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2863
3081
|
}
|
|
2864
3082
|
}
|
|
2865
3083
|
async setFloodlightLightSettingsBrightnessMotion(device, value) {
|
|
@@ -2868,10 +3086,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2868
3086
|
value: value
|
|
2869
3087
|
};
|
|
2870
3088
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2871
|
-
throw new error_1.WrongStationError(
|
|
3089
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2872
3090
|
}
|
|
2873
3091
|
if (!device.hasProperty(propertyData.name)) {
|
|
2874
|
-
throw new error_1.NotSupportedError(
|
|
3092
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2875
3093
|
}
|
|
2876
3094
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2877
3095
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2887,8 +3105,23 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2887
3105
|
property: propertyData
|
|
2888
3106
|
});
|
|
2889
3107
|
}
|
|
3108
|
+
else if (device.isWallLightCam()) {
|
|
3109
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
3110
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
3111
|
+
value: JSON.stringify({
|
|
3112
|
+
"commandType": types_2.CommandType.CMD_SET_LIGHT_CTRL_BRIGHT_PIR,
|
|
3113
|
+
"data": {
|
|
3114
|
+
"type": 0,
|
|
3115
|
+
"value": value,
|
|
3116
|
+
},
|
|
3117
|
+
}),
|
|
3118
|
+
channel: device.getChannel()
|
|
3119
|
+
}, {
|
|
3120
|
+
property: propertyData
|
|
3121
|
+
});
|
|
3122
|
+
}
|
|
2890
3123
|
else {
|
|
2891
|
-
throw new error_1.NotSupportedError(
|
|
3124
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2892
3125
|
}
|
|
2893
3126
|
}
|
|
2894
3127
|
async setFloodlightLightSettingsBrightnessSchedule(device, value) {
|
|
@@ -2897,10 +3130,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2897
3130
|
value: value
|
|
2898
3131
|
};
|
|
2899
3132
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2900
|
-
throw new error_1.WrongStationError(
|
|
3133
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2901
3134
|
}
|
|
2902
3135
|
if (!device.hasProperty(propertyData.name)) {
|
|
2903
|
-
throw new error_1.NotSupportedError(
|
|
3136
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2904
3137
|
}
|
|
2905
3138
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2906
3139
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2916,8 +3149,23 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2916
3149
|
property: propertyData
|
|
2917
3150
|
});
|
|
2918
3151
|
}
|
|
3152
|
+
else if (device.isWallLightCam()) {
|
|
3153
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
3154
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
3155
|
+
value: JSON.stringify({
|
|
3156
|
+
"commandType": types_2.CommandType.CMD_SET_LIGHT_CTRL_BRIGHT_SCH,
|
|
3157
|
+
"data": {
|
|
3158
|
+
"type": 0,
|
|
3159
|
+
"value": value,
|
|
3160
|
+
},
|
|
3161
|
+
}),
|
|
3162
|
+
channel: device.getChannel()
|
|
3163
|
+
}, {
|
|
3164
|
+
property: propertyData
|
|
3165
|
+
});
|
|
3166
|
+
}
|
|
2919
3167
|
else {
|
|
2920
|
-
throw new error_1.NotSupportedError(
|
|
3168
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2921
3169
|
}
|
|
2922
3170
|
}
|
|
2923
3171
|
async setFloodlightLightSettingsMotionTriggered(device, value) {
|
|
@@ -2926,10 +3174,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2926
3174
|
value: value
|
|
2927
3175
|
};
|
|
2928
3176
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2929
|
-
throw new error_1.WrongStationError(
|
|
3177
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2930
3178
|
}
|
|
2931
3179
|
if (!device.hasProperty(propertyData.name)) {
|
|
2932
|
-
throw new error_1.NotSupportedError(
|
|
3180
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2933
3181
|
}
|
|
2934
3182
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2935
3183
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2945,8 +3193,20 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2945
3193
|
property: propertyData
|
|
2946
3194
|
});
|
|
2947
3195
|
}
|
|
3196
|
+
else if (device.isWallLightCam()) {
|
|
3197
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
3198
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
3199
|
+
value: JSON.stringify({
|
|
3200
|
+
"commandType": types_2.CommandType.CMD_SET_LIGHT_CTRL_PIR_SWITCH,
|
|
3201
|
+
"data": value === true ? 1 : 0,
|
|
3202
|
+
}),
|
|
3203
|
+
channel: device.getChannel()
|
|
3204
|
+
}, {
|
|
3205
|
+
property: propertyData
|
|
3206
|
+
});
|
|
3207
|
+
}
|
|
2948
3208
|
else {
|
|
2949
|
-
throw new error_1.NotSupportedError(
|
|
3209
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2950
3210
|
}
|
|
2951
3211
|
}
|
|
2952
3212
|
async setFloodlightLightSettingsMotionTriggeredDistance(device, value) {
|
|
@@ -2955,10 +3215,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2955
3215
|
value: value
|
|
2956
3216
|
};
|
|
2957
3217
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
2958
|
-
throw new error_1.WrongStationError(
|
|
3218
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2959
3219
|
}
|
|
2960
3220
|
if (!device.hasProperty(propertyData.name)) {
|
|
2961
|
-
throw new error_1.NotSupportedError(
|
|
3221
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2962
3222
|
}
|
|
2963
3223
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
2964
3224
|
(0, utils_3.validValue)(property, value);
|
|
@@ -2980,7 +3240,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2980
3240
|
newValue = types_1.FloodlightMotionTriggeredDistance.MAX;
|
|
2981
3241
|
break;
|
|
2982
3242
|
default:
|
|
2983
|
-
throw new error_1.InvalidPropertyValueError(
|
|
3243
|
+
throw new error_1.InvalidPropertyValueError("Invalid value for this property", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2984
3244
|
}
|
|
2985
3245
|
this.log.debug(`Sending floodlight light settings motion triggered distance command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${newValue}`);
|
|
2986
3246
|
if (device.isFloodLight()) {
|
|
@@ -2995,7 +3255,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2995
3255
|
});
|
|
2996
3256
|
}
|
|
2997
3257
|
else {
|
|
2998
|
-
throw new error_1.NotSupportedError(
|
|
3258
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
2999
3259
|
}
|
|
3000
3260
|
}
|
|
3001
3261
|
async setFloodlightLightSettingsMotionTriggeredTimer(device, seconds) {
|
|
@@ -3004,10 +3264,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3004
3264
|
value: seconds
|
|
3005
3265
|
};
|
|
3006
3266
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3007
|
-
throw new error_1.WrongStationError(
|
|
3267
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3008
3268
|
}
|
|
3009
3269
|
if (!device.hasProperty(propertyData.name)) {
|
|
3010
|
-
throw new error_1.NotSupportedError(
|
|
3270
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3011
3271
|
}
|
|
3012
3272
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
3013
3273
|
(0, utils_3.validValue)(property, seconds);
|
|
@@ -3023,8 +3283,20 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3023
3283
|
property: propertyData
|
|
3024
3284
|
});
|
|
3025
3285
|
}
|
|
3286
|
+
else if (device.isWallLightCam()) {
|
|
3287
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
3288
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
3289
|
+
value: JSON.stringify({
|
|
3290
|
+
"commandType": types_2.CommandType.CMD_SET_LIGHT_CTRL_PIR_TIME,
|
|
3291
|
+
"data": seconds,
|
|
3292
|
+
}),
|
|
3293
|
+
channel: device.getChannel()
|
|
3294
|
+
}, {
|
|
3295
|
+
property: propertyData
|
|
3296
|
+
});
|
|
3297
|
+
}
|
|
3026
3298
|
else {
|
|
3027
|
-
throw new error_1.NotSupportedError(
|
|
3299
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3028
3300
|
}
|
|
3029
3301
|
}
|
|
3030
3302
|
async triggerStationAlarmSound(seconds) {
|
|
@@ -3033,7 +3305,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3033
3305
|
value: seconds
|
|
3034
3306
|
};
|
|
3035
3307
|
if (!this.hasCommand(types_1.CommandName.StationTriggerAlarmSound)) {
|
|
3036
|
-
throw new error_1.NotSupportedError(
|
|
3308
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { commandName: commandData.name, station: this.getSerial() } });
|
|
3037
3309
|
}
|
|
3038
3310
|
this.log.debug(`Sending trigger station alarm sound command to station ${this.getSerial()} with value: ${seconds}`);
|
|
3039
3311
|
if (!(0, utils_1.isGreaterEqualMinVersion)("2.0.7.9", this.getSoftwareVersion()) || device_1.Device.isIntegratedDeviceBySn(this.getSerial())) {
|
|
@@ -3074,10 +3346,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3074
3346
|
value: seconds
|
|
3075
3347
|
};
|
|
3076
3348
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3077
|
-
throw new error_1.WrongStationError(
|
|
3349
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3078
3350
|
}
|
|
3079
3351
|
if (!device.hasCommand(types_1.CommandName.DeviceTriggerAlarmSound)) {
|
|
3080
|
-
throw new error_1.NotSupportedError(
|
|
3352
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3081
3353
|
}
|
|
3082
3354
|
this.log.debug(`Sending trigger device alarm sound command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${seconds}`);
|
|
3083
3355
|
await this.p2pSession.sendCommandWithIntString({
|
|
@@ -3099,27 +3371,41 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3099
3371
|
value: value
|
|
3100
3372
|
};
|
|
3101
3373
|
if (!this.hasProperty(propertyData.name)) {
|
|
3102
|
-
throw new error_1.NotSupportedError(
|
|
3374
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
3103
3375
|
}
|
|
3104
3376
|
const property = this.getPropertyMetadata(propertyData.name);
|
|
3105
3377
|
(0, utils_3.validValue)(property, value);
|
|
3106
3378
|
this.log.debug(`Sending station alarm ringtone volume command to station ${this.getSerial()} with value: ${value}`);
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3379
|
+
if (device_1.Device.isWallLightCam(this.getDeviceType())) {
|
|
3380
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
3381
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
3382
|
+
value: JSON.stringify({
|
|
3383
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_ALERT_VOLUME,
|
|
3384
|
+
"data": value
|
|
3385
|
+
}),
|
|
3386
|
+
channel: 0
|
|
3387
|
+
}, {
|
|
3388
|
+
property: propertyData
|
|
3389
|
+
});
|
|
3390
|
+
}
|
|
3391
|
+
else {
|
|
3392
|
+
await this.p2pSession.sendCommandWithInt({
|
|
3393
|
+
commandType: types_2.CommandType.CMD_SET_HUB_SPK_VOLUME,
|
|
3394
|
+
value: value,
|
|
3395
|
+
strValue: this.rawStation.member.admin_user_id,
|
|
3396
|
+
channel: Station.CHANNEL
|
|
3397
|
+
}, {
|
|
3398
|
+
property: propertyData
|
|
3399
|
+
});
|
|
3400
|
+
}
|
|
3401
|
+
}
|
|
3402
|
+
async setStationAlarmTone(value) {
|
|
3403
|
+
const propertyData = {
|
|
3118
3404
|
name: types_1.PropertyName.StationAlarmTone,
|
|
3119
3405
|
value: value
|
|
3120
3406
|
};
|
|
3121
3407
|
if (!this.hasProperty(propertyData.name)) {
|
|
3122
|
-
throw new error_1.NotSupportedError(
|
|
3408
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
3123
3409
|
}
|
|
3124
3410
|
const property = this.getPropertyMetadata(propertyData.name);
|
|
3125
3411
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3145,7 +3431,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3145
3431
|
value: value
|
|
3146
3432
|
};
|
|
3147
3433
|
if (!this.hasProperty(propertyData.name)) {
|
|
3148
|
-
throw new error_1.NotSupportedError(
|
|
3434
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
3149
3435
|
}
|
|
3150
3436
|
const property = this.getPropertyMetadata(propertyData.name);
|
|
3151
3437
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3166,16 +3452,16 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3166
3452
|
});
|
|
3167
3453
|
}
|
|
3168
3454
|
async setStationNotificationSwitchMode(mode, value) {
|
|
3455
|
+
const propertyData = {
|
|
3456
|
+
name: mode === types_1.NotificationSwitchMode.APP ? types_1.PropertyName.StationNotificationSwitchModeApp : mode === types_1.NotificationSwitchMode.GEOFENCE ? types_1.PropertyName.StationNotificationSwitchModeGeofence : mode === types_1.NotificationSwitchMode.KEYPAD ? types_1.PropertyName.StationNotificationSwitchModeKeypad : mode === types_1.NotificationSwitchMode.SCHEDULE ? types_1.PropertyName.StationNotificationSwitchModeSchedule : "",
|
|
3457
|
+
value: value
|
|
3458
|
+
};
|
|
3169
3459
|
if ((!this.hasProperty(types_1.PropertyName.StationNotificationSwitchModeApp) && mode === types_1.NotificationSwitchMode.APP) ||
|
|
3170
3460
|
(!this.hasProperty(types_1.PropertyName.StationNotificationSwitchModeGeofence) && mode === types_1.NotificationSwitchMode.GEOFENCE) ||
|
|
3171
3461
|
(!this.hasProperty(types_1.PropertyName.StationNotificationSwitchModeKeypad) && mode === types_1.NotificationSwitchMode.KEYPAD) ||
|
|
3172
3462
|
(!this.hasProperty(types_1.PropertyName.StationNotificationSwitchModeSchedule) && mode === types_1.NotificationSwitchMode.SCHEDULE)) {
|
|
3173
|
-
throw new error_1.NotSupportedError(
|
|
3463
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
3174
3464
|
}
|
|
3175
|
-
const propertyData = {
|
|
3176
|
-
name: mode === types_1.NotificationSwitchMode.APP ? types_1.PropertyName.StationNotificationSwitchModeApp : mode === types_1.NotificationSwitchMode.GEOFENCE ? types_1.PropertyName.StationNotificationSwitchModeGeofence : mode === types_1.NotificationSwitchMode.KEYPAD ? types_1.PropertyName.StationNotificationSwitchModeKeypad : mode === types_1.NotificationSwitchMode.SCHEDULE ? types_1.PropertyName.StationNotificationSwitchModeSchedule : "",
|
|
3177
|
-
value: value
|
|
3178
|
-
};
|
|
3179
3465
|
const property = this.getPropertyMetadata(propertyData.name);
|
|
3180
3466
|
(0, utils_3.validValue)(property, value);
|
|
3181
3467
|
this.log.debug(`Sending station notification switch mode command to station ${this.getSerial()} with value: ${value}`);
|
|
@@ -3231,7 +3517,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3231
3517
|
value: value
|
|
3232
3518
|
};
|
|
3233
3519
|
if (!this.hasProperty(propertyData.name)) {
|
|
3234
|
-
throw new error_1.NotSupportedError(
|
|
3520
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
3235
3521
|
}
|
|
3236
3522
|
let pushmode = 0;
|
|
3237
3523
|
const rawproperty = this.getRawProperty(types_2.CommandType.CMD_HUB_NOTIFY_MODE);
|
|
@@ -3288,19 +3574,33 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3288
3574
|
value: value
|
|
3289
3575
|
};
|
|
3290
3576
|
if (!this.hasProperty(propertyData.name)) {
|
|
3291
|
-
throw new error_1.NotSupportedError(
|
|
3577
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
3292
3578
|
}
|
|
3293
3579
|
const property = this.getPropertyMetadata(propertyData.name);
|
|
3294
3580
|
(0, utils_3.validValue)(property, value);
|
|
3295
3581
|
this.log.debug(`Sending station time format command to station ${this.getSerial()} with value: ${types_1.TimeFormat[value]}`);
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3582
|
+
if (device_1.Device.isWallLightCam(this.getDeviceType())) {
|
|
3583
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
3584
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
3585
|
+
value: JSON.stringify({
|
|
3586
|
+
"commandType": types_2.CommandType.CMD_SET_HUB_OSD,
|
|
3587
|
+
"data": value
|
|
3588
|
+
}),
|
|
3589
|
+
channel: 0
|
|
3590
|
+
}, {
|
|
3591
|
+
property: propertyData
|
|
3592
|
+
});
|
|
3593
|
+
}
|
|
3594
|
+
else {
|
|
3595
|
+
await this.p2pSession.sendCommandWithInt({
|
|
3596
|
+
commandType: types_2.CommandType.CMD_SET_HUB_OSD,
|
|
3597
|
+
value: value,
|
|
3598
|
+
strValue: this.rawStation.member.admin_user_id,
|
|
3599
|
+
channel: Station.CHANNEL
|
|
3600
|
+
}, {
|
|
3601
|
+
property: propertyData
|
|
3602
|
+
});
|
|
3603
|
+
}
|
|
3304
3604
|
}
|
|
3305
3605
|
async setRTSPStream(device, value) {
|
|
3306
3606
|
const propertyData = {
|
|
@@ -3308,10 +3608,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3308
3608
|
value: value
|
|
3309
3609
|
};
|
|
3310
3610
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3311
|
-
throw new error_1.WrongStationError(
|
|
3611
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3312
3612
|
}
|
|
3313
3613
|
if (!device.hasProperty(propertyData.name)) {
|
|
3314
|
-
throw new error_1.NotSupportedError(
|
|
3614
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3315
3615
|
}
|
|
3316
3616
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
3317
3617
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3332,10 +3632,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3332
3632
|
value: value
|
|
3333
3633
|
};
|
|
3334
3634
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3335
|
-
throw new error_1.WrongStationError(
|
|
3635
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3336
3636
|
}
|
|
3337
3637
|
if (!device.hasProperty(propertyData.name)) {
|
|
3338
|
-
throw new error_1.NotSupportedError(
|
|
3638
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3339
3639
|
}
|
|
3340
3640
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
3341
3641
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3356,10 +3656,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3356
3656
|
value: value
|
|
3357
3657
|
};
|
|
3358
3658
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3359
|
-
throw new error_1.WrongStationError(
|
|
3659
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3360
3660
|
}
|
|
3361
3661
|
if (!device.hasProperty(propertyData.name)) {
|
|
3362
|
-
throw new error_1.NotSupportedError(
|
|
3662
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3363
3663
|
}
|
|
3364
3664
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
3365
3665
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3427,8 +3727,41 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3427
3727
|
property: propertyData
|
|
3428
3728
|
});
|
|
3429
3729
|
}
|
|
3730
|
+
else if (device.isWallLightCam()) {
|
|
3731
|
+
if (!Object.values(types_2.WatermarkSetting1).includes(value)) {
|
|
3732
|
+
this.log.error(`The device ${device.getSerial()} accepts only this type of values:`, types_2.WatermarkSetting1);
|
|
3733
|
+
return;
|
|
3734
|
+
}
|
|
3735
|
+
this.log.debug(`Sending watermark command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${types_2.WatermarkSetting1[value]}`);
|
|
3736
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
3737
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
3738
|
+
value: JSON.stringify({
|
|
3739
|
+
"commandType": types_2.CommandType.CMD_SET_DEVS_OSD,
|
|
3740
|
+
"data": value
|
|
3741
|
+
}),
|
|
3742
|
+
channel: device.getChannel()
|
|
3743
|
+
}, {
|
|
3744
|
+
property: propertyData
|
|
3745
|
+
});
|
|
3746
|
+
}
|
|
3747
|
+
else if (device.isGarageCamera()) {
|
|
3748
|
+
if (!Object.values(types_2.WatermarkSetting5).includes(value)) {
|
|
3749
|
+
this.log.error(`The device ${device.getSerial()} accepts only this type of values:`, types_2.WatermarkSetting5);
|
|
3750
|
+
return;
|
|
3751
|
+
}
|
|
3752
|
+
this.log.debug(`Sending watermark command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${types_2.WatermarkSetting5[value]}`);
|
|
3753
|
+
await this.p2pSession.sendCommandWithIntString({
|
|
3754
|
+
commandType: types_2.CommandType.CMD_SET_DEVS_OSD,
|
|
3755
|
+
value: value,
|
|
3756
|
+
valueSub: device.getChannel(),
|
|
3757
|
+
strValue: this.rawStation.member.admin_user_id,
|
|
3758
|
+
channel: device.getChannel()
|
|
3759
|
+
}, {
|
|
3760
|
+
property: propertyData
|
|
3761
|
+
});
|
|
3762
|
+
}
|
|
3430
3763
|
else {
|
|
3431
|
-
throw new error_1.NotSupportedError(
|
|
3764
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3432
3765
|
}
|
|
3433
3766
|
}
|
|
3434
3767
|
async enableDevice(device, value) {
|
|
@@ -3437,10 +3770,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3437
3770
|
value: value
|
|
3438
3771
|
};
|
|
3439
3772
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3440
|
-
throw new error_1.WrongStationError(
|
|
3773
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3441
3774
|
}
|
|
3442
3775
|
if (!device.hasProperty(propertyData.name)) {
|
|
3443
|
-
throw new error_1.NotSupportedError(
|
|
3776
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3444
3777
|
}
|
|
3445
3778
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
3446
3779
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3483,10 +3816,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3483
3816
|
}
|
|
3484
3817
|
};
|
|
3485
3818
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3486
|
-
throw new error_1.WrongStationError(
|
|
3819
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3487
3820
|
}
|
|
3488
3821
|
if (!device.hasCommand(types_1.CommandName.DeviceStartDownload)) {
|
|
3489
|
-
throw new error_1.NotSupportedError(
|
|
3822
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3490
3823
|
}
|
|
3491
3824
|
if (this.getDeviceType() === types_1.DeviceType.HB3) {
|
|
3492
3825
|
//TODO: Implement HB3 Support! Actually doesn't work and returns return_code -104 (ERROR_INVALID_ACCOUNT). It could be that we need the new encrypted p2p protocol to make this work...
|
|
@@ -3501,7 +3834,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3501
3834
|
mValue3: types_2.CommandType.CMD_DOWNLOAD_VIDEO,
|
|
3502
3835
|
payload: {
|
|
3503
3836
|
filepath: path,
|
|
3504
|
-
key: rsa_key
|
|
3837
|
+
key: rsa_key?.exportKey("components-public").n.slice(1).toString("hex").toUpperCase(),
|
|
3505
3838
|
}
|
|
3506
3839
|
}),
|
|
3507
3840
|
channel: device.getChannel()
|
|
@@ -3552,10 +3885,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3552
3885
|
name: types_1.CommandName.DeviceCancelDownload
|
|
3553
3886
|
};
|
|
3554
3887
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3555
|
-
throw new error_1.WrongStationError(
|
|
3888
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3556
3889
|
}
|
|
3557
3890
|
if (!device.hasCommand(types_1.CommandName.DeviceCancelDownload)) {
|
|
3558
|
-
throw new error_1.NotSupportedError(
|
|
3891
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3559
3892
|
}
|
|
3560
3893
|
this.log.debug(`Sending cancel download command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
3561
3894
|
await this.p2pSession.sendCommandWithInt({
|
|
@@ -3573,17 +3906,17 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3573
3906
|
value: videoCodec
|
|
3574
3907
|
};
|
|
3575
3908
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3576
|
-
throw new error_1.WrongStationError(
|
|
3909
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3577
3910
|
}
|
|
3578
3911
|
if (!device.hasCommand(types_1.CommandName.DeviceStartLivestream)) {
|
|
3579
|
-
throw new error_1.NotSupportedError(
|
|
3912
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3580
3913
|
}
|
|
3581
3914
|
if (this.isLiveStreaming(device)) {
|
|
3582
|
-
throw new error_2.LivestreamAlreadyRunningError(
|
|
3915
|
+
throw new error_2.LivestreamAlreadyRunningError("Livestream for device is already running", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3583
3916
|
}
|
|
3584
3917
|
this.log.debug(`Sending start livestream command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
3585
3918
|
const rsa_key = this.p2pSession.getRSAPrivateKey();
|
|
3586
|
-
if (device.isSoloCameras() || device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 || device.isWiredDoorbellT8200X()) {
|
|
3919
|
+
if (device.isSoloCameras() || device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 || device.isWiredDoorbellT8200X() || device.isWallLightCam() || device.isGarageCamera()) {
|
|
3587
3920
|
this.log.debug(`Using CMD_DOORBELL_SET_PAYLOAD (1) for station ${this.getSerial()} (main_sw_version: ${this.getSoftwareVersion()})`);
|
|
3588
3921
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
3589
3922
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
@@ -3591,7 +3924,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3591
3924
|
"commandType": types_1.ParamType.COMMAND_START_LIVESTREAM,
|
|
3592
3925
|
"data": {
|
|
3593
3926
|
"accountId": this.rawStation.member.admin_user_id,
|
|
3594
|
-
"encryptkey": rsa_key
|
|
3927
|
+
"encryptkey": rsa_key?.exportKey("components-public").n.slice(1).toString("hex"),
|
|
3595
3928
|
"streamtype": videoCodec
|
|
3596
3929
|
}
|
|
3597
3930
|
}),
|
|
@@ -3608,7 +3941,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3608
3941
|
"commandType": types_1.ParamType.COMMAND_START_LIVESTREAM,
|
|
3609
3942
|
"data": {
|
|
3610
3943
|
"account_id": this.rawStation.member.admin_user_id,
|
|
3611
|
-
"encryptkey": rsa_key
|
|
3944
|
+
"encryptkey": rsa_key?.exportKey("components-public").n.slice(1).toString("hex"),
|
|
3612
3945
|
"streamtype": videoCodec
|
|
3613
3946
|
}
|
|
3614
3947
|
}),
|
|
@@ -3623,7 +3956,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3623
3956
|
await this.p2pSession.sendCommandWithInt({
|
|
3624
3957
|
commandType: types_2.CommandType.CMD_START_REALTIME_MEDIA,
|
|
3625
3958
|
value: device.getChannel(),
|
|
3626
|
-
strValue: rsa_key
|
|
3959
|
+
strValue: rsa_key?.exportKey("components-public").n.slice(1).toString("hex"),
|
|
3627
3960
|
channel: device.getChannel()
|
|
3628
3961
|
}, {
|
|
3629
3962
|
command: commandData
|
|
@@ -3639,7 +3972,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3639
3972
|
"mValue3": types_2.CommandType.CMD_START_REALTIME_MEDIA,
|
|
3640
3973
|
"payload": {
|
|
3641
3974
|
"ClientOS": "Android",
|
|
3642
|
-
"key": rsa_key
|
|
3975
|
+
"key": rsa_key?.exportKey("components-public").n.slice(1).toString("hex"),
|
|
3643
3976
|
"streamtype": videoCodec === types_2.VideoCodec.H264 ? 1 : 2,
|
|
3644
3977
|
}
|
|
3645
3978
|
}),
|
|
@@ -3655,13 +3988,13 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3655
3988
|
name: types_1.CommandName.DeviceStopLivestream
|
|
3656
3989
|
};
|
|
3657
3990
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3658
|
-
throw new error_1.WrongStationError(
|
|
3991
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3659
3992
|
}
|
|
3660
3993
|
if (!device.hasCommand(types_1.CommandName.DeviceStopLivestream)) {
|
|
3661
|
-
throw new error_1.NotSupportedError(
|
|
3994
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3662
3995
|
}
|
|
3663
3996
|
if (!this.isLiveStreaming(device)) {
|
|
3664
|
-
throw new error_2.LivestreamNotRunningError(
|
|
3997
|
+
throw new error_2.LivestreamNotRunningError("Livestream for device is not running", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3665
3998
|
}
|
|
3666
3999
|
this.log.debug(`Sending stop livestream command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
3667
4000
|
await this.p2pSession.sendCommandWithInt({
|
|
@@ -3688,10 +4021,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3688
4021
|
value: voice_id
|
|
3689
4022
|
};
|
|
3690
4023
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3691
|
-
throw new error_1.WrongStationError(
|
|
4024
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3692
4025
|
}
|
|
3693
4026
|
if (!device.hasCommand(types_1.CommandName.DeviceQuickResponse)) {
|
|
3694
|
-
throw new error_1.NotSupportedError(
|
|
4027
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3695
4028
|
}
|
|
3696
4029
|
this.log.debug(`Sending quick response command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${voice_id}`);
|
|
3697
4030
|
if (device.isBatteryDoorbell()) {
|
|
@@ -3722,7 +4055,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3722
4055
|
});
|
|
3723
4056
|
}
|
|
3724
4057
|
else {
|
|
3725
|
-
throw new error_1.NotSupportedError(
|
|
4058
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
3726
4059
|
}
|
|
3727
4060
|
}
|
|
3728
4061
|
async setChirpVolume(device, value) {
|
|
@@ -3731,10 +4064,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3731
4064
|
value: value
|
|
3732
4065
|
};
|
|
3733
4066
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3734
|
-
throw new error_1.WrongStationError(
|
|
4067
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3735
4068
|
}
|
|
3736
4069
|
if (!device.hasProperty(propertyData.name)) {
|
|
3737
|
-
throw new error_1.NotSupportedError(
|
|
4070
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3738
4071
|
}
|
|
3739
4072
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
3740
4073
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3757,7 +4090,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3757
4090
|
});
|
|
3758
4091
|
}
|
|
3759
4092
|
else {
|
|
3760
|
-
throw new error_1.NotSupportedError(
|
|
4093
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3761
4094
|
}
|
|
3762
4095
|
}
|
|
3763
4096
|
async setChirpTone(device, value) {
|
|
@@ -3766,10 +4099,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3766
4099
|
value: value
|
|
3767
4100
|
};
|
|
3768
4101
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3769
|
-
throw new error_1.WrongStationError(
|
|
4102
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3770
4103
|
}
|
|
3771
4104
|
if (!device.hasProperty(propertyData.name)) {
|
|
3772
|
-
throw new error_1.NotSupportedError(
|
|
4105
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3773
4106
|
}
|
|
3774
4107
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
3775
4108
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3786,7 +4119,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3786
4119
|
});
|
|
3787
4120
|
}
|
|
3788
4121
|
else {
|
|
3789
|
-
throw new error_1.NotSupportedError(
|
|
4122
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3790
4123
|
}
|
|
3791
4124
|
}
|
|
3792
4125
|
async setHDR(device, value) {
|
|
@@ -3795,10 +4128,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3795
4128
|
value: value
|
|
3796
4129
|
};
|
|
3797
4130
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3798
|
-
throw new error_1.WrongStationError(
|
|
4131
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3799
4132
|
}
|
|
3800
4133
|
if (!device.hasProperty(propertyData.name)) {
|
|
3801
|
-
throw new error_1.NotSupportedError(
|
|
4134
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3802
4135
|
}
|
|
3803
4136
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
3804
4137
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3818,7 +4151,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3818
4151
|
});
|
|
3819
4152
|
}
|
|
3820
4153
|
else {
|
|
3821
|
-
throw new error_1.NotSupportedError(
|
|
4154
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3822
4155
|
}
|
|
3823
4156
|
}
|
|
3824
4157
|
async setDistortionCorrection(device, value) {
|
|
@@ -3827,10 +4160,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3827
4160
|
value: value
|
|
3828
4161
|
};
|
|
3829
4162
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3830
|
-
throw new error_1.WrongStationError(
|
|
4163
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3831
4164
|
}
|
|
3832
4165
|
if (!device.hasProperty(propertyData.name)) {
|
|
3833
|
-
throw new error_1.NotSupportedError(
|
|
4166
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3834
4167
|
}
|
|
3835
4168
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
3836
4169
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3850,7 +4183,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3850
4183
|
});
|
|
3851
4184
|
}
|
|
3852
4185
|
else {
|
|
3853
|
-
throw new error_1.NotSupportedError(
|
|
4186
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3854
4187
|
}
|
|
3855
4188
|
}
|
|
3856
4189
|
async setRingRecord(device, value) {
|
|
@@ -3859,10 +4192,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3859
4192
|
value: value
|
|
3860
4193
|
};
|
|
3861
4194
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3862
|
-
throw new error_1.WrongStationError(
|
|
4195
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3863
4196
|
}
|
|
3864
4197
|
if (!device.hasProperty(propertyData.name)) {
|
|
3865
|
-
throw new error_1.NotSupportedError(
|
|
4198
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3866
4199
|
}
|
|
3867
4200
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
3868
4201
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3882,7 +4215,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3882
4215
|
});
|
|
3883
4216
|
}
|
|
3884
4217
|
else {
|
|
3885
|
-
throw new error_1.NotSupportedError(
|
|
4218
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3886
4219
|
}
|
|
3887
4220
|
}
|
|
3888
4221
|
async lockDevice(device, value) {
|
|
@@ -3891,10 +4224,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3891
4224
|
value: value
|
|
3892
4225
|
};
|
|
3893
4226
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
3894
|
-
throw new error_1.WrongStationError(
|
|
4227
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3895
4228
|
}
|
|
3896
4229
|
if (!device.hasProperty(propertyData.name)) {
|
|
3897
|
-
throw new error_1.NotSupportedError(
|
|
4230
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3898
4231
|
}
|
|
3899
4232
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
3900
4233
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3949,7 +4282,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3949
4282
|
});
|
|
3950
4283
|
}
|
|
3951
4284
|
else {
|
|
3952
|
-
throw new error_1.NotSupportedError(
|
|
4285
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
3953
4286
|
}
|
|
3954
4287
|
}
|
|
3955
4288
|
async setStationSwitchModeWithAccessCode(value) {
|
|
@@ -3958,7 +4291,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3958
4291
|
value: value
|
|
3959
4292
|
};
|
|
3960
4293
|
if (!this.hasProperty(propertyData.name)) {
|
|
3961
|
-
throw new error_1.NotSupportedError(
|
|
4294
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
3962
4295
|
}
|
|
3963
4296
|
const property = this.getPropertyMetadata(propertyData.name);
|
|
3964
4297
|
(0, utils_3.validValue)(property, value);
|
|
@@ -3980,7 +4313,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3980
4313
|
});
|
|
3981
4314
|
}
|
|
3982
4315
|
else {
|
|
3983
|
-
throw new error_1.NotSupportedError(
|
|
4316
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
3984
4317
|
}
|
|
3985
4318
|
}
|
|
3986
4319
|
async setStationAutoEndAlarm(value) {
|
|
@@ -3989,7 +4322,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
3989
4322
|
value: value
|
|
3990
4323
|
};
|
|
3991
4324
|
if (!this.hasProperty(propertyData.name)) {
|
|
3992
|
-
throw new error_1.NotSupportedError(
|
|
4325
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
3993
4326
|
}
|
|
3994
4327
|
const property = this.getPropertyMetadata(propertyData.name);
|
|
3995
4328
|
(0, utils_3.validValue)(property, value);
|
|
@@ -4011,7 +4344,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4011
4344
|
});
|
|
4012
4345
|
}
|
|
4013
4346
|
else {
|
|
4014
|
-
throw new error_1.NotSupportedError(
|
|
4347
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
4015
4348
|
}
|
|
4016
4349
|
}
|
|
4017
4350
|
async setStationTurnOffAlarmWithButton(value) {
|
|
@@ -4020,7 +4353,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4020
4353
|
value: value
|
|
4021
4354
|
};
|
|
4022
4355
|
if (!this.hasProperty(propertyData.name)) {
|
|
4023
|
-
throw new error_1.NotSupportedError(
|
|
4356
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
4024
4357
|
}
|
|
4025
4358
|
const property = this.getPropertyMetadata(propertyData.name);
|
|
4026
4359
|
(0, utils_3.validValue)(property, value);
|
|
@@ -4042,24 +4375,24 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4042
4375
|
});
|
|
4043
4376
|
}
|
|
4044
4377
|
else {
|
|
4045
|
-
throw new error_1.NotSupportedError(
|
|
4378
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { propertyName: propertyData.name, propertyValue: propertyData.value, station: this.getSerial() } });
|
|
4046
4379
|
}
|
|
4047
4380
|
}
|
|
4048
4381
|
async startRTSPStream(device) {
|
|
4049
|
-
if (device.getStationSerial() !== this.getSerial()) {
|
|
4050
|
-
throw new error_1.WrongStationError(`Device ${device.getSerial()} is not managed by this station ${this.getSerial()}`);
|
|
4051
|
-
}
|
|
4052
|
-
if (!device.hasProperty(types_1.PropertyName.DeviceRTSPStream)) {
|
|
4053
|
-
throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
|
|
4054
|
-
}
|
|
4055
4382
|
const rtspStreamProperty = device.getPropertyValue(types_1.PropertyName.DeviceRTSPStream);
|
|
4056
4383
|
if (rtspStreamProperty !== undefined && rtspStreamProperty !== true) {
|
|
4057
|
-
throw new error_1.RTSPPropertyNotEnabledError(
|
|
4384
|
+
throw new error_1.RTSPPropertyNotEnabledError("RTSP setting for this device must be enabled first, to enable this functionality!", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: types_1.PropertyName.DeviceRTSPStream, propertyValue: rtspStreamProperty } });
|
|
4058
4385
|
}
|
|
4059
4386
|
const propertyData = {
|
|
4060
4387
|
name: types_1.PropertyName.DeviceRTSPStream,
|
|
4061
4388
|
value: rtspStreamProperty
|
|
4062
4389
|
};
|
|
4390
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
4391
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4392
|
+
}
|
|
4393
|
+
if (!device.hasProperty(types_1.PropertyName.DeviceRTSPStream)) {
|
|
4394
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4395
|
+
}
|
|
4063
4396
|
this.log.debug(`Start RTSP stream command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
4064
4397
|
await this.p2pSession.sendCommandWithIntString({
|
|
4065
4398
|
commandType: types_2.CommandType.CMD_NAS_TEST,
|
|
@@ -4072,20 +4405,20 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4072
4405
|
});
|
|
4073
4406
|
}
|
|
4074
4407
|
async stopRTSPStream(device) {
|
|
4075
|
-
if (device.getStationSerial() !== this.getSerial()) {
|
|
4076
|
-
throw new error_1.WrongStationError(`Device ${device.getSerial()} is not managed by this station ${this.getSerial()}`);
|
|
4077
|
-
}
|
|
4078
|
-
if (!device.hasProperty(types_1.PropertyName.DeviceRTSPStream)) {
|
|
4079
|
-
throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
|
|
4080
|
-
}
|
|
4081
4408
|
const rtspStreamProperty = device.getPropertyValue(types_1.PropertyName.DeviceRTSPStream);
|
|
4082
4409
|
if (rtspStreamProperty !== undefined && rtspStreamProperty !== true) {
|
|
4083
|
-
throw new error_1.RTSPPropertyNotEnabledError(
|
|
4410
|
+
throw new error_1.RTSPPropertyNotEnabledError("RTSP setting for this device must be enabled first, to enable this functionality!", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: types_1.PropertyName.DeviceRTSPStream, propertyValue: rtspStreamProperty } });
|
|
4084
4411
|
}
|
|
4085
4412
|
const propertyData = {
|
|
4086
4413
|
name: types_1.PropertyName.DeviceRTSPStream,
|
|
4087
4414
|
value: rtspStreamProperty
|
|
4088
4415
|
};
|
|
4416
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
4417
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4418
|
+
}
|
|
4419
|
+
if (!device.hasProperty(types_1.PropertyName.DeviceRTSPStream)) {
|
|
4420
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4421
|
+
}
|
|
4089
4422
|
this.log.debug(`Stop RTSP stream command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
4090
4423
|
await this.p2pSession.sendCommandWithIntString({
|
|
4091
4424
|
commandType: types_2.CommandType.CMD_NAS_TEST,
|
|
@@ -4103,10 +4436,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4103
4436
|
value: type
|
|
4104
4437
|
};
|
|
4105
4438
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4106
|
-
throw new error_1.WrongStationError(
|
|
4439
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4107
4440
|
}
|
|
4108
4441
|
if (!device.hasProperty(propertyData.name)) {
|
|
4109
|
-
throw new error_1.NotSupportedError(
|
|
4442
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4110
4443
|
}
|
|
4111
4444
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4112
4445
|
(0, utils_3.validValue)(property, type);
|
|
@@ -4126,7 +4459,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4126
4459
|
});
|
|
4127
4460
|
}
|
|
4128
4461
|
else {
|
|
4129
|
-
throw new error_1.NotSupportedError(
|
|
4462
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4130
4463
|
}
|
|
4131
4464
|
}
|
|
4132
4465
|
async setMotionDetectionRangeStandardSensitivity(device, sensitivity) {
|
|
@@ -4135,10 +4468,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4135
4468
|
value: sensitivity
|
|
4136
4469
|
};
|
|
4137
4470
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4138
|
-
throw new error_1.WrongStationError(
|
|
4471
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4139
4472
|
}
|
|
4140
4473
|
if (!device.hasProperty(propertyData.name)) {
|
|
4141
|
-
throw new error_1.NotSupportedError(
|
|
4474
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4142
4475
|
}
|
|
4143
4476
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4144
4477
|
(0, utils_3.validValue)(property, sensitivity);
|
|
@@ -4158,7 +4491,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4158
4491
|
});
|
|
4159
4492
|
}
|
|
4160
4493
|
else {
|
|
4161
|
-
throw new error_1.NotSupportedError(
|
|
4494
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4162
4495
|
}
|
|
4163
4496
|
}
|
|
4164
4497
|
async setMotionDetectionRangeAdvancedLeftSensitivity(device, sensitivity) {
|
|
@@ -4167,10 +4500,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4167
4500
|
value: sensitivity
|
|
4168
4501
|
};
|
|
4169
4502
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4170
|
-
throw new error_1.WrongStationError(
|
|
4503
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4171
4504
|
}
|
|
4172
4505
|
if (!device.hasProperty(propertyData.name)) {
|
|
4173
|
-
throw new error_1.NotSupportedError(
|
|
4506
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4174
4507
|
}
|
|
4175
4508
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4176
4509
|
(0, utils_3.validValue)(property, sensitivity);
|
|
@@ -4190,7 +4523,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4190
4523
|
});
|
|
4191
4524
|
}
|
|
4192
4525
|
else {
|
|
4193
|
-
throw new error_1.NotSupportedError(
|
|
4526
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4194
4527
|
}
|
|
4195
4528
|
}
|
|
4196
4529
|
async setMotionDetectionRangeAdvancedMiddleSensitivity(device, sensitivity) {
|
|
@@ -4199,10 +4532,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4199
4532
|
value: sensitivity
|
|
4200
4533
|
};
|
|
4201
4534
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4202
|
-
throw new error_1.WrongStationError(
|
|
4535
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4203
4536
|
}
|
|
4204
4537
|
if (!device.hasProperty(propertyData.name)) {
|
|
4205
|
-
throw new error_1.NotSupportedError(
|
|
4538
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4206
4539
|
}
|
|
4207
4540
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4208
4541
|
(0, utils_3.validValue)(property, sensitivity);
|
|
@@ -4222,7 +4555,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4222
4555
|
});
|
|
4223
4556
|
}
|
|
4224
4557
|
else {
|
|
4225
|
-
throw new error_1.NotSupportedError(
|
|
4558
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4226
4559
|
}
|
|
4227
4560
|
}
|
|
4228
4561
|
async setMotionDetectionRangeAdvancedRightSensitivity(device, sensitivity) {
|
|
@@ -4231,10 +4564,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4231
4564
|
value: sensitivity
|
|
4232
4565
|
};
|
|
4233
4566
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4234
|
-
throw new error_1.WrongStationError(
|
|
4567
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4235
4568
|
}
|
|
4236
4569
|
if (!device.hasProperty(propertyData.name)) {
|
|
4237
|
-
throw new error_1.NotSupportedError(
|
|
4570
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4238
4571
|
}
|
|
4239
4572
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4240
4573
|
(0, utils_3.validValue)(property, sensitivity);
|
|
@@ -4254,7 +4587,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4254
4587
|
});
|
|
4255
4588
|
}
|
|
4256
4589
|
else {
|
|
4257
|
-
throw new error_1.NotSupportedError(
|
|
4590
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4258
4591
|
}
|
|
4259
4592
|
}
|
|
4260
4593
|
async setMotionDetectionTestMode(device, enabled) {
|
|
@@ -4263,10 +4596,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4263
4596
|
value: enabled
|
|
4264
4597
|
};
|
|
4265
4598
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4266
|
-
throw new error_1.WrongStationError(
|
|
4599
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4267
4600
|
}
|
|
4268
4601
|
if (!device.hasProperty(propertyData.name)) {
|
|
4269
|
-
throw new error_1.NotSupportedError(
|
|
4602
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4270
4603
|
}
|
|
4271
4604
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4272
4605
|
(0, utils_3.validValue)(property, enabled);
|
|
@@ -4283,7 +4616,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4283
4616
|
});
|
|
4284
4617
|
}
|
|
4285
4618
|
else {
|
|
4286
|
-
throw new error_1.NotSupportedError(
|
|
4619
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4287
4620
|
}
|
|
4288
4621
|
}
|
|
4289
4622
|
async setMotionTrackingSensitivity(device, sensitivity) {
|
|
@@ -4292,10 +4625,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4292
4625
|
value: sensitivity
|
|
4293
4626
|
};
|
|
4294
4627
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4295
|
-
throw new error_1.WrongStationError(
|
|
4628
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4296
4629
|
}
|
|
4297
4630
|
if (!device.hasProperty(propertyData.name)) {
|
|
4298
|
-
throw new error_1.NotSupportedError(
|
|
4631
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4299
4632
|
}
|
|
4300
4633
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4301
4634
|
(0, utils_3.validValue)(property, sensitivity);
|
|
@@ -4315,7 +4648,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4315
4648
|
});
|
|
4316
4649
|
}
|
|
4317
4650
|
else {
|
|
4318
|
-
throw new error_1.NotSupportedError(
|
|
4651
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4319
4652
|
}
|
|
4320
4653
|
}
|
|
4321
4654
|
async setMotionAutoCruise(device, enabled) {
|
|
@@ -4324,10 +4657,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4324
4657
|
value: enabled
|
|
4325
4658
|
};
|
|
4326
4659
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4327
|
-
throw new error_1.WrongStationError(
|
|
4660
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4328
4661
|
}
|
|
4329
4662
|
if (!device.hasProperty(propertyData.name)) {
|
|
4330
|
-
throw new error_1.NotSupportedError(
|
|
4663
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4331
4664
|
}
|
|
4332
4665
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4333
4666
|
(0, utils_3.validValue)(property, enabled);
|
|
@@ -4347,7 +4680,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4347
4680
|
});
|
|
4348
4681
|
}
|
|
4349
4682
|
else {
|
|
4350
|
-
throw new error_1.NotSupportedError(
|
|
4683
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4351
4684
|
}
|
|
4352
4685
|
}
|
|
4353
4686
|
async setMotionOutOfViewDetection(device, enabled) {
|
|
@@ -4356,10 +4689,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4356
4689
|
value: enabled
|
|
4357
4690
|
};
|
|
4358
4691
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4359
|
-
throw new error_1.WrongStationError(
|
|
4692
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4360
4693
|
}
|
|
4361
4694
|
if (!device.hasProperty(propertyData.name)) {
|
|
4362
|
-
throw new error_1.NotSupportedError(
|
|
4695
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4363
4696
|
}
|
|
4364
4697
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4365
4698
|
(0, utils_3.validValue)(property, enabled);
|
|
@@ -4379,7 +4712,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4379
4712
|
});
|
|
4380
4713
|
}
|
|
4381
4714
|
else {
|
|
4382
|
-
throw new error_1.NotSupportedError(
|
|
4715
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4383
4716
|
}
|
|
4384
4717
|
}
|
|
4385
4718
|
async setLightSettingsColorTemperatureManual(device, value) {
|
|
@@ -4388,10 +4721,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4388
4721
|
value: value
|
|
4389
4722
|
};
|
|
4390
4723
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4391
|
-
throw new error_1.WrongStationError(
|
|
4724
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4392
4725
|
}
|
|
4393
4726
|
if (!device.hasProperty(propertyData.name)) {
|
|
4394
|
-
throw new error_1.NotSupportedError(
|
|
4727
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4395
4728
|
}
|
|
4396
4729
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4397
4730
|
(0, utils_3.validValue)(property, value);
|
|
@@ -4411,7 +4744,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4411
4744
|
});
|
|
4412
4745
|
}
|
|
4413
4746
|
else {
|
|
4414
|
-
throw new error_1.NotSupportedError(
|
|
4747
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4415
4748
|
}
|
|
4416
4749
|
}
|
|
4417
4750
|
async setLightSettingsColorTemperatureMotion(device, value) {
|
|
@@ -4420,10 +4753,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4420
4753
|
value: value
|
|
4421
4754
|
};
|
|
4422
4755
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4423
|
-
throw new error_1.WrongStationError(
|
|
4756
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4424
4757
|
}
|
|
4425
4758
|
if (!device.hasProperty(propertyData.name)) {
|
|
4426
|
-
throw new error_1.NotSupportedError(
|
|
4759
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4427
4760
|
}
|
|
4428
4761
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4429
4762
|
(0, utils_3.validValue)(property, value);
|
|
@@ -4443,7 +4776,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4443
4776
|
});
|
|
4444
4777
|
}
|
|
4445
4778
|
else {
|
|
4446
|
-
throw new error_1.NotSupportedError(
|
|
4779
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4447
4780
|
}
|
|
4448
4781
|
}
|
|
4449
4782
|
async setLightSettingsColorTemperatureSchedule(device, value) {
|
|
@@ -4452,10 +4785,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4452
4785
|
value: value
|
|
4453
4786
|
};
|
|
4454
4787
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4455
|
-
throw new error_1.WrongStationError(
|
|
4788
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4456
4789
|
}
|
|
4457
4790
|
if (!device.hasProperty(propertyData.name)) {
|
|
4458
|
-
throw new error_1.NotSupportedError(
|
|
4791
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4459
4792
|
}
|
|
4460
4793
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4461
4794
|
(0, utils_3.validValue)(property, value);
|
|
@@ -4475,7 +4808,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4475
4808
|
});
|
|
4476
4809
|
}
|
|
4477
4810
|
else {
|
|
4478
|
-
throw new error_1.NotSupportedError(
|
|
4811
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4479
4812
|
}
|
|
4480
4813
|
}
|
|
4481
4814
|
async setLightSettingsMotionActivationMode(device, value) {
|
|
@@ -4484,10 +4817,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4484
4817
|
value: value
|
|
4485
4818
|
};
|
|
4486
4819
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4487
|
-
throw new error_1.WrongStationError(
|
|
4820
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4488
4821
|
}
|
|
4489
4822
|
if (!device.hasProperty(propertyData.name)) {
|
|
4490
|
-
throw new error_1.NotSupportedError(
|
|
4823
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4491
4824
|
}
|
|
4492
4825
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4493
4826
|
(0, utils_3.validValue)(property, value);
|
|
@@ -4503,8 +4836,20 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4503
4836
|
property: propertyData
|
|
4504
4837
|
});
|
|
4505
4838
|
}
|
|
4839
|
+
else if (device.isWallLightCam()) {
|
|
4840
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
4841
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
4842
|
+
value: JSON.stringify({
|
|
4843
|
+
"commandType": types_2.CommandType.CMD_SET_FLOODLIGHT_STREET_LAMP,
|
|
4844
|
+
"data": value,
|
|
4845
|
+
}),
|
|
4846
|
+
channel: device.getChannel()
|
|
4847
|
+
}, {
|
|
4848
|
+
property: propertyData
|
|
4849
|
+
});
|
|
4850
|
+
}
|
|
4506
4851
|
else {
|
|
4507
|
-
throw new error_1.NotSupportedError(
|
|
4852
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4508
4853
|
}
|
|
4509
4854
|
}
|
|
4510
4855
|
async setVideoNightvisionImageAdjustment(device, enabled) {
|
|
@@ -4513,10 +4858,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4513
4858
|
value: enabled
|
|
4514
4859
|
};
|
|
4515
4860
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4516
|
-
throw new error_1.WrongStationError(
|
|
4861
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4517
4862
|
}
|
|
4518
4863
|
if (!device.hasProperty(propertyData.name)) {
|
|
4519
|
-
throw new error_1.NotSupportedError(
|
|
4864
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4520
4865
|
}
|
|
4521
4866
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4522
4867
|
(0, utils_3.validValue)(property, enabled);
|
|
@@ -4536,7 +4881,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4536
4881
|
});
|
|
4537
4882
|
}
|
|
4538
4883
|
else {
|
|
4539
|
-
throw new error_1.NotSupportedError(
|
|
4884
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4540
4885
|
}
|
|
4541
4886
|
}
|
|
4542
4887
|
async setVideoColorNightvision(device, enabled) {
|
|
@@ -4545,10 +4890,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4545
4890
|
value: enabled
|
|
4546
4891
|
};
|
|
4547
4892
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4548
|
-
throw new error_1.WrongStationError(
|
|
4893
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4549
4894
|
}
|
|
4550
4895
|
if (!device.hasProperty(propertyData.name)) {
|
|
4551
|
-
throw new error_1.NotSupportedError(
|
|
4896
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4552
4897
|
}
|
|
4553
4898
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4554
4899
|
(0, utils_3.validValue)(property, enabled);
|
|
@@ -4568,7 +4913,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4568
4913
|
});
|
|
4569
4914
|
}
|
|
4570
4915
|
else {
|
|
4571
|
-
throw new error_1.NotSupportedError(
|
|
4916
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4572
4917
|
}
|
|
4573
4918
|
}
|
|
4574
4919
|
async setAutoCalibration(device, enabled) {
|
|
@@ -4577,10 +4922,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4577
4922
|
value: enabled
|
|
4578
4923
|
};
|
|
4579
4924
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4580
|
-
throw new error_1.WrongStationError(
|
|
4925
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4581
4926
|
}
|
|
4582
4927
|
if (!device.hasProperty(propertyData.name)) {
|
|
4583
|
-
throw new error_1.NotSupportedError(
|
|
4928
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4584
4929
|
}
|
|
4585
4930
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4586
4931
|
(0, utils_3.validValue)(property, enabled);
|
|
@@ -4600,7 +4945,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4600
4945
|
});
|
|
4601
4946
|
}
|
|
4602
4947
|
else {
|
|
4603
|
-
throw new error_1.NotSupportedError(
|
|
4948
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4604
4949
|
}
|
|
4605
4950
|
}
|
|
4606
4951
|
isRTSPLiveStreaming(device) {
|
|
@@ -4642,10 +4987,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4642
4987
|
name: types_1.CommandName.DeviceLockCalibration
|
|
4643
4988
|
};
|
|
4644
4989
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4645
|
-
throw new error_1.WrongStationError(
|
|
4990
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
4646
4991
|
}
|
|
4647
4992
|
if (!this.hasCommand(types_1.CommandName.DeviceLockCalibration)) {
|
|
4648
|
-
throw new error_1.NotSupportedError(
|
|
4993
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
4649
4994
|
}
|
|
4650
4995
|
this.log.debug(`Sending calibrate lock command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
4651
4996
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -4667,7 +5012,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4667
5012
|
});
|
|
4668
5013
|
}
|
|
4669
5014
|
else {
|
|
4670
|
-
throw new error_1.NotSupportedError(
|
|
5015
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
4671
5016
|
}
|
|
4672
5017
|
}
|
|
4673
5018
|
convertAdvancedLockSettingValue(property, value) {
|
|
@@ -4755,10 +5100,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4755
5100
|
value: value
|
|
4756
5101
|
};
|
|
4757
5102
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4758
|
-
throw new error_1.WrongStationError(
|
|
5103
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4759
5104
|
}
|
|
4760
5105
|
if (!device.hasProperty(propertyData.name)) {
|
|
4761
|
-
throw new error_1.NotSupportedError(
|
|
5106
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4762
5107
|
}
|
|
4763
5108
|
const propertyMetadata = device.getPropertyMetadata(propertyData.name);
|
|
4764
5109
|
(0, utils_3.validValue)(propertyMetadata, value);
|
|
@@ -4777,11 +5122,11 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4777
5122
|
}
|
|
4778
5123
|
else {
|
|
4779
5124
|
this.log.warn(`Internal lock property for property ${property} not identified for ${device.getSerial()}`, { p2pParamName: p2pParamName });
|
|
4780
|
-
throw new error_2.InvalidPropertyError(
|
|
5125
|
+
throw new error_2.InvalidPropertyError("Internal lock property for property not identified for this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4781
5126
|
}
|
|
4782
5127
|
}
|
|
4783
5128
|
else {
|
|
4784
|
-
throw new error_1.NotSupportedError(
|
|
5129
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4785
5130
|
}
|
|
4786
5131
|
}
|
|
4787
5132
|
async setLoiteringDetection(device, value) {
|
|
@@ -4790,10 +5135,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4790
5135
|
value: value
|
|
4791
5136
|
};
|
|
4792
5137
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4793
|
-
throw new error_1.WrongStationError(
|
|
5138
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4794
5139
|
}
|
|
4795
5140
|
if (!device.hasProperty(propertyData.name)) {
|
|
4796
|
-
throw new error_1.NotSupportedError(
|
|
5141
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4797
5142
|
}
|
|
4798
5143
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4799
5144
|
(0, utils_3.validValue)(property, value);
|
|
@@ -4816,7 +5161,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4816
5161
|
});
|
|
4817
5162
|
}
|
|
4818
5163
|
else {
|
|
4819
|
-
throw new error_1.NotSupportedError(
|
|
5164
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4820
5165
|
}
|
|
4821
5166
|
}
|
|
4822
5167
|
async setLoiteringDetectionRange(device, value) {
|
|
@@ -4825,10 +5170,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4825
5170
|
value: value
|
|
4826
5171
|
};
|
|
4827
5172
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4828
|
-
throw new error_1.WrongStationError(
|
|
5173
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4829
5174
|
}
|
|
4830
5175
|
if (!device.hasProperty(propertyData.name)) {
|
|
4831
|
-
throw new error_1.NotSupportedError(
|
|
5176
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4832
5177
|
}
|
|
4833
5178
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4834
5179
|
(0, utils_3.validValue)(property, value);
|
|
@@ -4851,7 +5196,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4851
5196
|
});
|
|
4852
5197
|
}
|
|
4853
5198
|
else {
|
|
4854
|
-
throw new error_1.NotSupportedError(
|
|
5199
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4855
5200
|
}
|
|
4856
5201
|
}
|
|
4857
5202
|
async setLoiteringDetectionLength(device, value) {
|
|
@@ -4860,10 +5205,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4860
5205
|
value: value
|
|
4861
5206
|
};
|
|
4862
5207
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4863
|
-
throw new error_1.WrongStationError(
|
|
5208
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4864
5209
|
}
|
|
4865
5210
|
if (!device.hasProperty(propertyData.name)) {
|
|
4866
|
-
throw new error_1.NotSupportedError(
|
|
5211
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4867
5212
|
}
|
|
4868
5213
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4869
5214
|
(0, utils_3.validValue)(property, value);
|
|
@@ -4886,15 +5231,15 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4886
5231
|
});
|
|
4887
5232
|
}
|
|
4888
5233
|
else {
|
|
4889
|
-
throw new error_1.NotSupportedError(
|
|
5234
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4890
5235
|
}
|
|
4891
5236
|
}
|
|
4892
5237
|
async _setMotionDetectionSensitivity(device, propertyData, mode, blocklist) {
|
|
4893
5238
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
4894
|
-
throw new error_1.WrongStationError(
|
|
5239
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4895
5240
|
}
|
|
4896
5241
|
if (!device.hasProperty(propertyData.name)) {
|
|
4897
|
-
throw new error_1.NotSupportedError(
|
|
5242
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4898
5243
|
}
|
|
4899
5244
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
4900
5245
|
(0, utils_3.validValue)(property, propertyData.value);
|
|
@@ -4918,7 +5263,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
4918
5263
|
});
|
|
4919
5264
|
}
|
|
4920
5265
|
else {
|
|
4921
|
-
throw new error_1.NotSupportedError(
|
|
5266
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
4922
5267
|
}
|
|
4923
5268
|
}
|
|
4924
5269
|
_getMotionDetectionSensitivityAdvanced(device) {
|
|
@@ -5028,10 +5373,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5028
5373
|
}
|
|
5029
5374
|
async _setLoiteringCustomResponse(device, propertyData, voiceID, autoVoiceResponse, homebaseAlert, pushNotification, startTime, endTime) {
|
|
5030
5375
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5031
|
-
throw new error_1.WrongStationError(
|
|
5376
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5032
5377
|
}
|
|
5033
5378
|
if (!device.hasProperty(propertyData.name)) {
|
|
5034
|
-
throw new error_1.NotSupportedError(
|
|
5379
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5035
5380
|
}
|
|
5036
5381
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5037
5382
|
(0, utils_3.validValue)(property, propertyData.value);
|
|
@@ -5067,7 +5412,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5067
5412
|
});
|
|
5068
5413
|
}
|
|
5069
5414
|
else {
|
|
5070
|
-
throw new error_1.NotSupportedError(
|
|
5415
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5071
5416
|
}
|
|
5072
5417
|
}
|
|
5073
5418
|
async setLoiteringCustomResponseAutoVoiceResponse(device, value) {
|
|
@@ -5118,10 +5463,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5118
5463
|
value: value
|
|
5119
5464
|
};
|
|
5120
5465
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5121
|
-
throw new error_1.WrongStationError(
|
|
5466
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5122
5467
|
}
|
|
5123
5468
|
if (!device.hasProperty(propertyData.name)) {
|
|
5124
|
-
throw new error_1.NotSupportedError(
|
|
5469
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5125
5470
|
}
|
|
5126
5471
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5127
5472
|
(0, utils_3.validValue)(property, value);
|
|
@@ -5145,7 +5490,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5145
5490
|
});
|
|
5146
5491
|
}
|
|
5147
5492
|
else {
|
|
5148
|
-
throw new error_1.NotSupportedError(
|
|
5493
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5149
5494
|
}
|
|
5150
5495
|
}
|
|
5151
5496
|
async setDeliveryGuardPackageGuarding(device, value) {
|
|
@@ -5154,10 +5499,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5154
5499
|
value: value
|
|
5155
5500
|
};
|
|
5156
5501
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5157
|
-
throw new error_1.WrongStationError(
|
|
5502
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5158
5503
|
}
|
|
5159
5504
|
if (!device.hasProperty(propertyData.name)) {
|
|
5160
|
-
throw new error_1.NotSupportedError(
|
|
5505
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5161
5506
|
}
|
|
5162
5507
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5163
5508
|
(0, utils_3.validValue)(property, value);
|
|
@@ -5180,7 +5525,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5180
5525
|
});
|
|
5181
5526
|
}
|
|
5182
5527
|
else {
|
|
5183
|
-
throw new error_1.NotSupportedError(
|
|
5528
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5184
5529
|
}
|
|
5185
5530
|
}
|
|
5186
5531
|
async setDeliveryGuardPackageGuardingVoiceResponseVoice(device, value) {
|
|
@@ -5189,10 +5534,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5189
5534
|
value: value
|
|
5190
5535
|
};
|
|
5191
5536
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5192
|
-
throw new error_1.WrongStationError(
|
|
5537
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5193
5538
|
}
|
|
5194
5539
|
if (!device.hasProperty(propertyData.name)) {
|
|
5195
|
-
throw new error_1.NotSupportedError(
|
|
5540
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5196
5541
|
}
|
|
5197
5542
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5198
5543
|
(0, utils_3.validValue)(property, propertyData.value);
|
|
@@ -5216,15 +5561,15 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5216
5561
|
});
|
|
5217
5562
|
}
|
|
5218
5563
|
else {
|
|
5219
|
-
throw new error_1.NotSupportedError(
|
|
5564
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5220
5565
|
}
|
|
5221
5566
|
}
|
|
5222
5567
|
async setDeliveryGuardPackageGuardingActivatedTime(device, propertyData, startTime, endTime) {
|
|
5223
5568
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5224
|
-
throw new error_1.WrongStationError(
|
|
5569
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5225
5570
|
}
|
|
5226
5571
|
if (!device.hasProperty(propertyData.name)) {
|
|
5227
|
-
throw new error_1.NotSupportedError(
|
|
5572
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5228
5573
|
}
|
|
5229
5574
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5230
5575
|
(0, utils_3.validValue)(property, propertyData.value);
|
|
@@ -5250,7 +5595,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5250
5595
|
});
|
|
5251
5596
|
}
|
|
5252
5597
|
else {
|
|
5253
|
-
throw new error_1.NotSupportedError(
|
|
5598
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5254
5599
|
}
|
|
5255
5600
|
}
|
|
5256
5601
|
async setDeliveryGuardPackageGuardingActivatedTimeFrom(device, value) {
|
|
@@ -5273,10 +5618,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5273
5618
|
value: value
|
|
5274
5619
|
};
|
|
5275
5620
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5276
|
-
throw new error_1.WrongStationError(
|
|
5621
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5277
5622
|
}
|
|
5278
5623
|
if (!device.hasProperty(propertyData.name)) {
|
|
5279
|
-
throw new error_1.NotSupportedError(
|
|
5624
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5280
5625
|
}
|
|
5281
5626
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5282
5627
|
(0, utils_3.validValue)(property, value);
|
|
@@ -5299,7 +5644,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5299
5644
|
});
|
|
5300
5645
|
}
|
|
5301
5646
|
else {
|
|
5302
|
-
throw new error_1.NotSupportedError(
|
|
5647
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5303
5648
|
}
|
|
5304
5649
|
}
|
|
5305
5650
|
async setDeliveryGuardUncollectedPackageAlertTimeToCheck(device, value) {
|
|
@@ -5308,10 +5653,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5308
5653
|
value: value
|
|
5309
5654
|
};
|
|
5310
5655
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5311
|
-
throw new error_1.WrongStationError(
|
|
5656
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5312
5657
|
}
|
|
5313
5658
|
if (!device.hasProperty(propertyData.name)) {
|
|
5314
|
-
throw new error_1.NotSupportedError(
|
|
5659
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5315
5660
|
}
|
|
5316
5661
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5317
5662
|
(0, utils_3.validValue)(property, propertyData.value);
|
|
@@ -5335,7 +5680,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5335
5680
|
});
|
|
5336
5681
|
}
|
|
5337
5682
|
else {
|
|
5338
|
-
throw new error_1.NotSupportedError(
|
|
5683
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5339
5684
|
}
|
|
5340
5685
|
}
|
|
5341
5686
|
async setDeliveryGuardPackageLiveCheckAssistance(device, value) {
|
|
@@ -5344,10 +5689,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5344
5689
|
value: value
|
|
5345
5690
|
};
|
|
5346
5691
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5347
|
-
throw new error_1.WrongStationError(
|
|
5692
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5348
5693
|
}
|
|
5349
5694
|
if (!device.hasProperty(propertyData.name)) {
|
|
5350
|
-
throw new error_1.NotSupportedError(
|
|
5695
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5351
5696
|
}
|
|
5352
5697
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5353
5698
|
(0, utils_3.validValue)(property, value);
|
|
@@ -5370,7 +5715,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5370
5715
|
});
|
|
5371
5716
|
}
|
|
5372
5717
|
else {
|
|
5373
|
-
throw new error_1.NotSupportedError(
|
|
5718
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5374
5719
|
}
|
|
5375
5720
|
}
|
|
5376
5721
|
async setDualCamWatchViewMode(device, value) {
|
|
@@ -5379,10 +5724,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5379
5724
|
value: value
|
|
5380
5725
|
};
|
|
5381
5726
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5382
|
-
throw new error_1.WrongStationError(
|
|
5727
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5383
5728
|
}
|
|
5384
5729
|
if (!device.hasProperty(propertyData.name)) {
|
|
5385
|
-
throw new error_1.NotSupportedError(
|
|
5730
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5386
5731
|
}
|
|
5387
5732
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5388
5733
|
(0, utils_3.validValue)(property, propertyData.value);
|
|
@@ -5406,15 +5751,15 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5406
5751
|
});
|
|
5407
5752
|
}
|
|
5408
5753
|
else {
|
|
5409
|
-
throw new error_1.NotSupportedError(
|
|
5754
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5410
5755
|
}
|
|
5411
5756
|
}
|
|
5412
5757
|
async _setRingAutoResponse(device, propertyData, enabled, voiceID, autoVoiceResponse, startTime, endTime) {
|
|
5413
5758
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5414
|
-
throw new error_1.WrongStationError(
|
|
5759
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5415
5760
|
}
|
|
5416
5761
|
if (!device.hasProperty(propertyData.name)) {
|
|
5417
|
-
throw new error_1.NotSupportedError(
|
|
5762
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5418
5763
|
}
|
|
5419
5764
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5420
5765
|
(0, utils_3.validValue)(property, propertyData.value);
|
|
@@ -5448,7 +5793,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5448
5793
|
});
|
|
5449
5794
|
}
|
|
5450
5795
|
else {
|
|
5451
|
-
throw new error_1.NotSupportedError(
|
|
5796
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5452
5797
|
}
|
|
5453
5798
|
}
|
|
5454
5799
|
async setRingAutoResponse(device, value) {
|
|
@@ -5492,10 +5837,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5492
5837
|
value: value
|
|
5493
5838
|
};
|
|
5494
5839
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5495
|
-
throw new error_1.WrongStationError(
|
|
5840
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5496
5841
|
}
|
|
5497
5842
|
if (!device.hasProperty(propertyData.name)) {
|
|
5498
|
-
throw new error_1.NotSupportedError(
|
|
5843
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5499
5844
|
}
|
|
5500
5845
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5501
5846
|
(0, utils_3.validValue)(property, value);
|
|
@@ -5518,7 +5863,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5518
5863
|
});
|
|
5519
5864
|
}
|
|
5520
5865
|
else {
|
|
5521
|
-
throw new error_1.NotSupportedError(
|
|
5866
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5522
5867
|
}
|
|
5523
5868
|
}
|
|
5524
5869
|
async calibrate(device) {
|
|
@@ -5526,10 +5871,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5526
5871
|
name: types_1.CommandName.DeviceCalibrate
|
|
5527
5872
|
};
|
|
5528
5873
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5529
|
-
throw new error_1.WrongStationError(
|
|
5874
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5530
5875
|
}
|
|
5531
5876
|
if (!device.hasCommand(types_1.CommandName.DeviceCalibrate)) {
|
|
5532
|
-
throw new error_1.NotSupportedError(
|
|
5877
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5533
5878
|
}
|
|
5534
5879
|
this.log.debug(`Sending calibrate command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
5535
5880
|
if (device.isPanAndTiltCamera()) {
|
|
@@ -5544,7 +5889,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5544
5889
|
});
|
|
5545
5890
|
}
|
|
5546
5891
|
else {
|
|
5547
|
-
throw new error_1.NotSupportedError(
|
|
5892
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5548
5893
|
}
|
|
5549
5894
|
}
|
|
5550
5895
|
async setContinuousRecording(device, value) {
|
|
@@ -5553,10 +5898,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5553
5898
|
value: value
|
|
5554
5899
|
};
|
|
5555
5900
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5556
|
-
throw new error_1.WrongStationError(
|
|
5901
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5557
5902
|
}
|
|
5558
5903
|
if (!device.hasProperty(propertyData.name)) {
|
|
5559
|
-
throw new error_1.NotSupportedError(
|
|
5904
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5560
5905
|
}
|
|
5561
5906
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5562
5907
|
(0, utils_3.validValue)(property, value);
|
|
@@ -5587,10 +5932,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5587
5932
|
value: value
|
|
5588
5933
|
};
|
|
5589
5934
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5590
|
-
throw new error_1.WrongStationError(
|
|
5935
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5591
5936
|
}
|
|
5592
5937
|
if (!device.hasProperty(propertyData.name)) {
|
|
5593
|
-
throw new error_1.NotSupportedError(
|
|
5938
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5594
5939
|
}
|
|
5595
5940
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5596
5941
|
(0, utils_3.validValue)(property, value);
|
|
@@ -5621,10 +5966,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5621
5966
|
value: value
|
|
5622
5967
|
};
|
|
5623
5968
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5624
|
-
throw new error_1.WrongStationError(
|
|
5969
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5625
5970
|
}
|
|
5626
5971
|
if (!device.hasProperty(propertyData.name)) {
|
|
5627
|
-
throw new error_1.NotSupportedError(
|
|
5972
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5628
5973
|
}
|
|
5629
5974
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5630
5975
|
(0, utils_3.validValue)(property, value);
|
|
@@ -5648,10 +5993,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5648
5993
|
value: value
|
|
5649
5994
|
};
|
|
5650
5995
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5651
|
-
throw new error_1.WrongStationError(
|
|
5996
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5652
5997
|
}
|
|
5653
5998
|
if (!device.hasProperty(propertyData.name)) {
|
|
5654
|
-
throw new error_1.NotSupportedError(
|
|
5999
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5655
6000
|
}
|
|
5656
6001
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5657
6002
|
(0, utils_3.validValue)(property, value);
|
|
@@ -5674,10 +6019,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5674
6019
|
name: types_1.CommandName.DeviceSetDefaultAngle
|
|
5675
6020
|
};
|
|
5676
6021
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5677
|
-
throw new error_1.WrongStationError(
|
|
6022
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5678
6023
|
}
|
|
5679
6024
|
if (!device.hasCommand(types_1.CommandName.DeviceSetDefaultAngle)) {
|
|
5680
|
-
throw new error_1.NotSupportedError(
|
|
6025
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5681
6026
|
}
|
|
5682
6027
|
this.log.debug(`Sending set default angle command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
5683
6028
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
@@ -5698,10 +6043,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5698
6043
|
name: types_1.CommandName.DeviceSetPrivacyAngle
|
|
5699
6044
|
};
|
|
5700
6045
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5701
|
-
throw new error_1.WrongStationError(
|
|
6046
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5702
6047
|
}
|
|
5703
6048
|
if (!device.hasCommand(types_1.CommandName.DeviceSetPrivacyAngle)) {
|
|
5704
|
-
throw new error_1.NotSupportedError(
|
|
6049
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5705
6050
|
}
|
|
5706
6051
|
this.log.debug(`Sending set privacy angle command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
5707
6052
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
@@ -5723,10 +6068,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5723
6068
|
value: value
|
|
5724
6069
|
};
|
|
5725
6070
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5726
|
-
throw new error_1.WrongStationError(
|
|
6071
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5727
6072
|
}
|
|
5728
6073
|
if (!device.hasProperty(propertyData.name)) {
|
|
5729
|
-
throw new error_1.NotSupportedError(
|
|
6074
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5730
6075
|
}
|
|
5731
6076
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5732
6077
|
(0, utils_3.validValue)(property, value);
|
|
@@ -5746,10 +6091,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5746
6091
|
value: value
|
|
5747
6092
|
};
|
|
5748
6093
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5749
|
-
throw new error_1.WrongStationError(
|
|
6094
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5750
6095
|
}
|
|
5751
6096
|
if (!device.hasProperty(propertyData.name)) {
|
|
5752
|
-
throw new error_1.NotSupportedError(
|
|
6097
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5753
6098
|
}
|
|
5754
6099
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
5755
6100
|
(0, utils_3.validValue)(property, value);
|
|
@@ -5772,16 +6117,16 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5772
6117
|
name: types_1.CommandName.DeviceStartTalkback
|
|
5773
6118
|
};
|
|
5774
6119
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5775
|
-
throw new error_1.WrongStationError(
|
|
6120
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5776
6121
|
}
|
|
5777
6122
|
if (!device.hasCommand(types_1.CommandName.DeviceStartTalkback)) {
|
|
5778
|
-
throw new error_1.NotSupportedError(
|
|
6123
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5779
6124
|
}
|
|
5780
6125
|
if (!this.isLiveStreaming(device)) {
|
|
5781
|
-
throw new error_2.LivestreamNotRunningError(
|
|
6126
|
+
throw new error_2.LivestreamNotRunningError("Livestream for device is not running", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5782
6127
|
}
|
|
5783
6128
|
this.log.debug(`Sending start talkback command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
5784
|
-
if (device.isIndoorCamera() || device.isSoloCamera() || device.isFloodLight() || device.isWiredDoorbell() || device.isSmartDrop() || device.isStarlight4GLTE()) {
|
|
6129
|
+
if (device.isIndoorCamera() || device.isSoloCamera() || device.isFloodLight() || device.isWiredDoorbell() || device.isSmartDrop() || device.isStarlight4GLTE() || device.isWallLightCam() || device.isGarageCamera()) {
|
|
5785
6130
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
5786
6131
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
5787
6132
|
value: JSON.stringify({
|
|
@@ -5818,16 +6163,16 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5818
6163
|
name: types_1.CommandName.DeviceStopTalkback
|
|
5819
6164
|
};
|
|
5820
6165
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5821
|
-
throw new error_1.WrongStationError(
|
|
6166
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5822
6167
|
}
|
|
5823
6168
|
if (!device.hasCommand(types_1.CommandName.DeviceStopTalkback)) {
|
|
5824
|
-
throw new error_1.NotSupportedError(
|
|
6169
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5825
6170
|
}
|
|
5826
6171
|
if (!this.isLiveStreaming(device)) {
|
|
5827
|
-
throw new error_2.LivestreamNotRunningError(
|
|
6172
|
+
throw new error_2.LivestreamNotRunningError("Livestream for device is not running", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
5828
6173
|
}
|
|
5829
6174
|
this.log.debug(`Sending stop talkback command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
5830
|
-
if (device.isIndoorCamera() || device.isSoloCamera() || device.isFloodLight() || device.isWiredDoorbell() || device.isSmartDrop() || device.isStarlight4GLTE()) {
|
|
6175
|
+
if (device.isIndoorCamera() || device.isSoloCamera() || device.isFloodLight() || device.isWiredDoorbell() || device.isSmartDrop() || device.isStarlight4GLTE() || device.isWallLightCam() || device.isGarageCamera()) {
|
|
5831
6176
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
5832
6177
|
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
5833
6178
|
value: JSON.stringify({
|
|
@@ -5879,10 +6224,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5879
6224
|
value: value
|
|
5880
6225
|
};
|
|
5881
6226
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5882
|
-
throw new error_1.WrongStationError(
|
|
6227
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5883
6228
|
}
|
|
5884
6229
|
if (!device.hasProperty(propertyData.name)) {
|
|
5885
|
-
throw new error_1.NotSupportedError(
|
|
6230
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5886
6231
|
}
|
|
5887
6232
|
this.log.debug(`Sending scramble passcode command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
5888
6233
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -5895,7 +6240,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5895
6240
|
await this.setSmartSafeParams(device, types_1.PropertyName.DeviceScramblePasscode, value);
|
|
5896
6241
|
}
|
|
5897
6242
|
else {
|
|
5898
|
-
throw new error_1.NotSupportedError(
|
|
6243
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5899
6244
|
}
|
|
5900
6245
|
}
|
|
5901
6246
|
async setWrongTryProtection(device, value) {
|
|
@@ -5904,10 +6249,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5904
6249
|
value: value
|
|
5905
6250
|
};
|
|
5906
6251
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5907
|
-
throw new error_1.WrongStationError(
|
|
6252
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5908
6253
|
}
|
|
5909
6254
|
if (!device.hasProperty(propertyData.name)) {
|
|
5910
|
-
throw new error_1.NotSupportedError(
|
|
6255
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5911
6256
|
}
|
|
5912
6257
|
this.log.debug(`Sending wrong try protection command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
5913
6258
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -5920,7 +6265,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5920
6265
|
await this.setSmartSafeParams(device, types_1.PropertyName.DeviceWrongTryProtection, value);
|
|
5921
6266
|
}
|
|
5922
6267
|
else {
|
|
5923
|
-
throw new error_1.NotSupportedError(
|
|
6268
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5924
6269
|
}
|
|
5925
6270
|
}
|
|
5926
6271
|
async setWrongTryAttempts(device, value) {
|
|
@@ -5929,10 +6274,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5929
6274
|
value: value
|
|
5930
6275
|
};
|
|
5931
6276
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5932
|
-
throw new error_1.WrongStationError(
|
|
6277
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5933
6278
|
}
|
|
5934
6279
|
if (!device.hasProperty(propertyData.name)) {
|
|
5935
|
-
throw new error_1.NotSupportedError(
|
|
6280
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5936
6281
|
}
|
|
5937
6282
|
this.log.debug(`Sending wrong try attempts command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
5938
6283
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -5945,7 +6290,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5945
6290
|
await this.setSmartSafeParams(device, types_1.PropertyName.DeviceWrongTryAttempts, value);
|
|
5946
6291
|
}
|
|
5947
6292
|
else {
|
|
5948
|
-
throw new error_1.NotSupportedError(
|
|
6293
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5949
6294
|
}
|
|
5950
6295
|
}
|
|
5951
6296
|
async setWrongTryLockdownTime(device, value) {
|
|
@@ -5954,10 +6299,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5954
6299
|
value: value
|
|
5955
6300
|
};
|
|
5956
6301
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5957
|
-
throw new error_1.WrongStationError(
|
|
6302
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5958
6303
|
}
|
|
5959
6304
|
if (!device.hasProperty(propertyData.name)) {
|
|
5960
|
-
throw new error_1.NotSupportedError(
|
|
6305
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5961
6306
|
}
|
|
5962
6307
|
this.log.debug(`Sending wrong try lockdown time command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
5963
6308
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -5970,7 +6315,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5970
6315
|
await this.setSmartSafeParams(device, types_1.PropertyName.DeviceWrongTryLockdownTime, value);
|
|
5971
6316
|
}
|
|
5972
6317
|
else {
|
|
5973
|
-
throw new error_1.NotSupportedError(
|
|
6318
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5974
6319
|
}
|
|
5975
6320
|
}
|
|
5976
6321
|
async _sendSmartSafeCommand(device, command, data, customData) {
|
|
@@ -5983,10 +6328,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
5983
6328
|
value: value
|
|
5984
6329
|
};
|
|
5985
6330
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
5986
|
-
throw new error_1.WrongStationError(
|
|
6331
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5987
6332
|
}
|
|
5988
6333
|
if (!device.hasProperty(propertyData.name)) {
|
|
5989
|
-
throw new error_1.NotSupportedError(
|
|
6334
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
5990
6335
|
}
|
|
5991
6336
|
const propertyMetadata = device.getPropertyMetadata(propertyData.name);
|
|
5992
6337
|
(0, utils_3.validValue)(propertyMetadata, value);
|
|
@@ -6039,7 +6384,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6039
6384
|
case types_1.PropertyName.DeviceRemoteUnlockMasterPIN:
|
|
6040
6385
|
{
|
|
6041
6386
|
if (!this.pinVerified && value === true) {
|
|
6042
|
-
throw new error_1.PinNotVerifiedError(
|
|
6387
|
+
throw new error_1.PinNotVerifiedError("You need to call verifyPIN with correct PIN first to enable this property", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6043
6388
|
}
|
|
6044
6389
|
let newValue = 2;
|
|
6045
6390
|
const remoteUnlock = property === types_1.PropertyName.DeviceRemoteUnlock ? value : device.getPropertyValue(types_1.PropertyName.DeviceRemoteUnlock);
|
|
@@ -6102,7 +6447,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6102
6447
|
await this._sendSmartSafeCommand(device, command, payload, { property: propertyData });
|
|
6103
6448
|
}
|
|
6104
6449
|
else {
|
|
6105
|
-
throw new error_1.NotSupportedError(
|
|
6450
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6106
6451
|
}
|
|
6107
6452
|
}
|
|
6108
6453
|
async unlock(device) {
|
|
@@ -6110,10 +6455,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6110
6455
|
name: types_1.CommandName.DeviceUnlock
|
|
6111
6456
|
};
|
|
6112
6457
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6113
|
-
throw new error_1.WrongStationError(
|
|
6458
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
6114
6459
|
}
|
|
6115
6460
|
if (!device.hasCommand(types_1.CommandName.DeviceUnlock)) {
|
|
6116
|
-
throw new error_1.NotSupportedError(
|
|
6461
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
6117
6462
|
}
|
|
6118
6463
|
const payload = device_1.SmartSafe.encodeCmdUnlock(this.rawStation.member.admin_user_id);
|
|
6119
6464
|
this.log.debug(`Sending trigger device unlock command to station ${this.getSerial()} for device ${device.getSerial()}`, { payload: payload.toString("hex") });
|
|
@@ -6124,13 +6469,13 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6124
6469
|
name: types_1.CommandName.DeviceVerifyPIN
|
|
6125
6470
|
};
|
|
6126
6471
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6127
|
-
throw new error_1.WrongStationError(
|
|
6472
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
6128
6473
|
}
|
|
6129
6474
|
if (!device.hasCommand(types_1.CommandName.DeviceVerifyPIN)) {
|
|
6130
|
-
throw new error_1.NotSupportedError(
|
|
6475
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
6131
6476
|
}
|
|
6132
6477
|
if (!/^[1-6]{4,8}$/.test(pin)) {
|
|
6133
|
-
throw new error_1.InvalidCommandValueError(
|
|
6478
|
+
throw new error_1.InvalidCommandValueError("PIN should contain only numbers (1-6) and be between 4 and 8 long", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6134
6479
|
}
|
|
6135
6480
|
const payload = device_1.SmartSafe.encodeCmdVerifyPIN(this.rawStation.member.admin_user_id, pin);
|
|
6136
6481
|
this.log.debug(`Sending device verify pin command to station ${this.getSerial()} for device ${device.getSerial()}`, { payload: payload.toString("hex") });
|
|
@@ -6160,10 +6505,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6160
6505
|
value: value
|
|
6161
6506
|
};
|
|
6162
6507
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6163
|
-
throw new error_1.WrongStationError(
|
|
6508
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6164
6509
|
}
|
|
6165
6510
|
if (!device.hasProperty(propertyData.name)) {
|
|
6166
|
-
throw new error_1.NotSupportedError(
|
|
6511
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6167
6512
|
}
|
|
6168
6513
|
const property = device.getPropertyMetadata(propertyData.name);
|
|
6169
6514
|
(0, utils_3.validValue)(property, value);
|
|
@@ -6197,10 +6542,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6197
6542
|
value: value
|
|
6198
6543
|
};
|
|
6199
6544
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6200
|
-
throw new error_1.WrongStationError(
|
|
6545
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6201
6546
|
}
|
|
6202
6547
|
if (!device.hasCommand(types_1.CommandName.DeviceSnooze)) {
|
|
6203
|
-
throw new error_1.NotSupportedError(
|
|
6548
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6204
6549
|
}
|
|
6205
6550
|
this.log.debug(`Sending snooze command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
6206
6551
|
if (device.isDoorbell()) {
|
|
@@ -6243,13 +6588,13 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6243
6588
|
}
|
|
6244
6589
|
};
|
|
6245
6590
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6246
|
-
throw new error_1.WrongStationError(
|
|
6591
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6247
6592
|
}
|
|
6248
6593
|
if (!device.hasCommand(types_1.CommandName.DeviceAddUser)) {
|
|
6249
|
-
throw new error_1.NotSupportedError(
|
|
6594
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6250
6595
|
}
|
|
6251
6596
|
if (!/^\d{4,8}$/.test(passcode)) {
|
|
6252
|
-
throw new error_1.InvalidCommandValueError(
|
|
6597
|
+
throw new error_1.InvalidCommandValueError("Passcode should contain only numbers and be between 4 and 8 long", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6253
6598
|
}
|
|
6254
6599
|
this.log.debug(`Sending add user command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6255
6600
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -6287,7 +6632,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6287
6632
|
});
|
|
6288
6633
|
}
|
|
6289
6634
|
else {
|
|
6290
|
-
throw new error_1.NotSupportedError(
|
|
6635
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6291
6636
|
}
|
|
6292
6637
|
}
|
|
6293
6638
|
async deleteUser(device, username, shortUserId) {
|
|
@@ -6299,10 +6644,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6299
6644
|
}
|
|
6300
6645
|
};
|
|
6301
6646
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6302
|
-
throw new error_1.WrongStationError(
|
|
6647
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6303
6648
|
}
|
|
6304
6649
|
if (!device.hasCommand(types_1.CommandName.DeviceDeleteUser)) {
|
|
6305
|
-
throw new error_1.NotSupportedError(
|
|
6650
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6306
6651
|
}
|
|
6307
6652
|
this.log.debug(`Sending delete user command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6308
6653
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -6325,7 +6670,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6325
6670
|
});
|
|
6326
6671
|
}
|
|
6327
6672
|
else {
|
|
6328
|
-
throw new error_1.NotSupportedError(
|
|
6673
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6329
6674
|
}
|
|
6330
6675
|
}
|
|
6331
6676
|
async updateUserSchedule(device, username, shortUserId, schedule) {
|
|
@@ -6338,10 +6683,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6338
6683
|
}
|
|
6339
6684
|
};
|
|
6340
6685
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6341
|
-
throw new error_1.WrongStationError(
|
|
6686
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6342
6687
|
}
|
|
6343
6688
|
if (!device.hasCommand(types_1.CommandName.DeviceUpdateUserSchedule)) {
|
|
6344
|
-
throw new error_1.NotSupportedError(
|
|
6689
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6345
6690
|
}
|
|
6346
6691
|
this.log.debug(`Sending update user schedule command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6347
6692
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -6369,7 +6714,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6369
6714
|
});
|
|
6370
6715
|
}
|
|
6371
6716
|
else {
|
|
6372
|
-
throw new error_1.NotSupportedError(
|
|
6717
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6373
6718
|
}
|
|
6374
6719
|
}
|
|
6375
6720
|
async updateUserPasscode(device, username, shortUserId, passcode) {
|
|
@@ -6382,13 +6727,13 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6382
6727
|
}
|
|
6383
6728
|
};
|
|
6384
6729
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6385
|
-
throw new error_1.WrongStationError(
|
|
6730
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6386
6731
|
}
|
|
6387
6732
|
if (!device.hasCommand(types_1.CommandName.DeviceUpdateUserPasscode)) {
|
|
6388
|
-
throw new error_1.NotSupportedError(
|
|
6733
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commonValue: commandData.value } });
|
|
6389
6734
|
}
|
|
6390
6735
|
if (passcode.length < 4 || passcode.length > 8 || !/^\d+$/.test(passcode)) {
|
|
6391
|
-
throw new error_1.InvalidCommandValueError(
|
|
6736
|
+
throw new error_1.InvalidCommandValueError("Passcode should contain only numbers and be between 4 and 8 long", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6392
6737
|
}
|
|
6393
6738
|
this.log.debug(`Sending update user passcode command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6394
6739
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -6412,7 +6757,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6412
6757
|
});
|
|
6413
6758
|
}
|
|
6414
6759
|
else {
|
|
6415
|
-
throw new error_1.NotSupportedError(
|
|
6760
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
|
|
6416
6761
|
}
|
|
6417
6762
|
}
|
|
6418
6763
|
async setLockV12Params(device, property, value) {
|
|
@@ -6421,10 +6766,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6421
6766
|
value: value
|
|
6422
6767
|
};
|
|
6423
6768
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6424
|
-
throw new error_1.WrongStationError(
|
|
6769
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6425
6770
|
}
|
|
6426
6771
|
if (!device.hasProperty(propertyData.name)) {
|
|
6427
|
-
throw new error_1.NotSupportedError(
|
|
6772
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6428
6773
|
}
|
|
6429
6774
|
const propertyMetadata = device.getPropertyMetadata(propertyData.name);
|
|
6430
6775
|
(0, utils_3.validValue)(propertyMetadata, value);
|
|
@@ -6476,7 +6821,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6476
6821
|
});
|
|
6477
6822
|
}
|
|
6478
6823
|
else {
|
|
6479
|
-
throw new error_1.NotSupportedError(
|
|
6824
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6480
6825
|
}
|
|
6481
6826
|
}
|
|
6482
6827
|
async setAutoLock(device, value) {
|
|
@@ -6485,10 +6830,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6485
6830
|
value: value
|
|
6486
6831
|
};
|
|
6487
6832
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6488
|
-
throw new error_1.WrongStationError(
|
|
6833
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6489
6834
|
}
|
|
6490
6835
|
if (!device.hasProperty(propertyData.name)) {
|
|
6491
|
-
throw new error_1.NotSupportedError(
|
|
6836
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6492
6837
|
}
|
|
6493
6838
|
this.log.debug(`Sending auto lock command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6494
6839
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -6498,7 +6843,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6498
6843
|
await this.setLockV12Params(device, types_1.PropertyName.DeviceAutoLock, value);
|
|
6499
6844
|
}
|
|
6500
6845
|
else {
|
|
6501
|
-
throw new error_1.NotSupportedError(
|
|
6846
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6502
6847
|
}
|
|
6503
6848
|
}
|
|
6504
6849
|
async setAutoLockSchedule(device, value) {
|
|
@@ -6507,10 +6852,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6507
6852
|
value: value
|
|
6508
6853
|
};
|
|
6509
6854
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6510
|
-
throw new error_1.WrongStationError(
|
|
6855
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6511
6856
|
}
|
|
6512
6857
|
if (!device.hasProperty(propertyData.name)) {
|
|
6513
|
-
throw new error_1.NotSupportedError(
|
|
6858
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6514
6859
|
}
|
|
6515
6860
|
this.log.debug(`Sending auto lock schedule command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6516
6861
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -6520,7 +6865,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6520
6865
|
await this.setLockV12Params(device, types_1.PropertyName.DeviceAutoLockSchedule, value);
|
|
6521
6866
|
}
|
|
6522
6867
|
else {
|
|
6523
|
-
throw new error_1.NotSupportedError(
|
|
6868
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6524
6869
|
}
|
|
6525
6870
|
}
|
|
6526
6871
|
async setAutoLockScheduleStartTime(device, value) {
|
|
@@ -6529,10 +6874,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6529
6874
|
value: value
|
|
6530
6875
|
};
|
|
6531
6876
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6532
|
-
throw new error_1.WrongStationError(
|
|
6877
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6533
6878
|
}
|
|
6534
6879
|
if (!device.hasProperty(propertyData.name)) {
|
|
6535
|
-
throw new error_1.NotSupportedError(
|
|
6880
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6536
6881
|
}
|
|
6537
6882
|
this.log.debug(`Sending auto lock schedule start time command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6538
6883
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -6542,7 +6887,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6542
6887
|
await this.setLockV12Params(device, types_1.PropertyName.DeviceAutoLockScheduleStartTime, value);
|
|
6543
6888
|
}
|
|
6544
6889
|
else {
|
|
6545
|
-
throw new error_1.NotSupportedError(
|
|
6890
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6546
6891
|
}
|
|
6547
6892
|
}
|
|
6548
6893
|
async setAutoLockScheduleEndTime(device, value) {
|
|
@@ -6551,10 +6896,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6551
6896
|
value: value
|
|
6552
6897
|
};
|
|
6553
6898
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6554
|
-
throw new error_1.WrongStationError(
|
|
6899
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6555
6900
|
}
|
|
6556
6901
|
if (!device.hasProperty(propertyData.name)) {
|
|
6557
|
-
throw new error_1.NotSupportedError(
|
|
6902
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6558
6903
|
}
|
|
6559
6904
|
this.log.debug(`Sending auto lock schedule end time command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6560
6905
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -6564,7 +6909,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6564
6909
|
await this.setLockV12Params(device, types_1.PropertyName.DeviceAutoLockScheduleEndTime, value);
|
|
6565
6910
|
}
|
|
6566
6911
|
else {
|
|
6567
|
-
throw new error_1.NotSupportedError(
|
|
6912
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6568
6913
|
}
|
|
6569
6914
|
}
|
|
6570
6915
|
async setAutoLockTimer(device, value) {
|
|
@@ -6573,10 +6918,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6573
6918
|
value: value
|
|
6574
6919
|
};
|
|
6575
6920
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6576
|
-
throw new error_1.WrongStationError(
|
|
6921
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6577
6922
|
}
|
|
6578
6923
|
if (!device.hasProperty(propertyData.name)) {
|
|
6579
|
-
throw new error_1.NotSupportedError(
|
|
6924
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6580
6925
|
}
|
|
6581
6926
|
this.log.debug(`Sending auto lock timer command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6582
6927
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -6586,7 +6931,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6586
6931
|
await this.setLockV12Params(device, types_1.PropertyName.DeviceAutoLockTimer, value);
|
|
6587
6932
|
}
|
|
6588
6933
|
else {
|
|
6589
|
-
throw new error_1.NotSupportedError(
|
|
6934
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6590
6935
|
}
|
|
6591
6936
|
}
|
|
6592
6937
|
async setOneTouchLocking(device, value) {
|
|
@@ -6595,10 +6940,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6595
6940
|
value: value
|
|
6596
6941
|
};
|
|
6597
6942
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6598
|
-
throw new error_1.WrongStationError(
|
|
6943
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6599
6944
|
}
|
|
6600
6945
|
if (!device.hasProperty(propertyData.name)) {
|
|
6601
|
-
throw new error_1.NotSupportedError(
|
|
6946
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6602
6947
|
}
|
|
6603
6948
|
this.log.debug(`Sending one touch locking command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6604
6949
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -6608,7 +6953,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6608
6953
|
await this.setLockV12Params(device, types_1.PropertyName.DeviceOneTouchLocking, value);
|
|
6609
6954
|
}
|
|
6610
6955
|
else {
|
|
6611
|
-
throw new error_1.NotSupportedError(
|
|
6956
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6612
6957
|
}
|
|
6613
6958
|
}
|
|
6614
6959
|
async setSound(device, value) {
|
|
@@ -6617,10 +6962,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6617
6962
|
value: value
|
|
6618
6963
|
};
|
|
6619
6964
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6620
|
-
throw new error_1.WrongStationError(
|
|
6965
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6621
6966
|
}
|
|
6622
6967
|
if (!device.hasProperty(propertyData.name)) {
|
|
6623
|
-
throw new error_1.NotSupportedError(
|
|
6968
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6624
6969
|
}
|
|
6625
6970
|
this.log.debug(`Sending sound command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6626
6971
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
@@ -6630,7 +6975,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6630
6975
|
await this.setLockV12Params(device, types_1.PropertyName.DeviceSound, value);
|
|
6631
6976
|
}
|
|
6632
6977
|
else {
|
|
6633
|
-
throw new error_1.NotSupportedError(
|
|
6978
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6634
6979
|
}
|
|
6635
6980
|
}
|
|
6636
6981
|
async setNotification(device, value) {
|
|
@@ -6639,20 +6984,32 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6639
6984
|
value: value
|
|
6640
6985
|
};
|
|
6641
6986
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6642
|
-
throw new error_1.WrongStationError(
|
|
6987
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6643
6988
|
}
|
|
6644
6989
|
if (!device.hasProperty(propertyData.name)) {
|
|
6645
|
-
throw new error_1.NotSupportedError(
|
|
6990
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6646
6991
|
}
|
|
6647
6992
|
this.log.debug(`Sending notification command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6648
6993
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
6649
6994
|
await this.setAdvancedLockParams(device, types_1.PropertyName.DeviceNotification, value);
|
|
6650
6995
|
}
|
|
6651
6996
|
else if (device.isLockWifiR10() || device.isLockWifiR20()) {
|
|
6652
|
-
//TODO:
|
|
6997
|
+
//TODO: Implement LockWifiR10 / LockWifiR20 commnand
|
|
6998
|
+
}
|
|
6999
|
+
else if (device.isWallLightCam()) {
|
|
7000
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7001
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7002
|
+
value: JSON.stringify({
|
|
7003
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_NOTIFICATION,
|
|
7004
|
+
"data": value === true ? 1 : 0,
|
|
7005
|
+
}),
|
|
7006
|
+
channel: device.getChannel()
|
|
7007
|
+
}, {
|
|
7008
|
+
property: propertyData
|
|
7009
|
+
});
|
|
6653
7010
|
}
|
|
6654
7011
|
else {
|
|
6655
|
-
throw new error_1.NotSupportedError(
|
|
7012
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6656
7013
|
}
|
|
6657
7014
|
}
|
|
6658
7015
|
async setNotificationLocked(device, value) {
|
|
@@ -6661,20 +7018,20 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6661
7018
|
value: value
|
|
6662
7019
|
};
|
|
6663
7020
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6664
|
-
throw new error_1.WrongStationError(
|
|
7021
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6665
7022
|
}
|
|
6666
7023
|
if (!device.hasProperty(propertyData.name)) {
|
|
6667
|
-
throw new error_1.NotSupportedError(
|
|
7024
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6668
7025
|
}
|
|
6669
7026
|
this.log.debug(`Sending notification locked command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6670
7027
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
6671
7028
|
await this.setAdvancedLockParams(device, types_1.PropertyName.DeviceNotificationLocked, value);
|
|
6672
7029
|
}
|
|
6673
7030
|
else if (device.isLockWifiR10() || device.isLockWifiR20()) {
|
|
6674
|
-
//TODO:
|
|
7031
|
+
//TODO: Implement LockWifiR10 / LockWifiR20 commnand
|
|
6675
7032
|
}
|
|
6676
7033
|
else {
|
|
6677
|
-
throw new error_1.NotSupportedError(
|
|
7034
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6678
7035
|
}
|
|
6679
7036
|
}
|
|
6680
7037
|
async setNotificationUnlocked(device, value) {
|
|
@@ -6683,20 +7040,20 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6683
7040
|
value: value
|
|
6684
7041
|
};
|
|
6685
7042
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6686
|
-
throw new error_1.WrongStationError(
|
|
7043
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6687
7044
|
}
|
|
6688
7045
|
if (!device.hasProperty(propertyData.name)) {
|
|
6689
|
-
throw new error_1.NotSupportedError(
|
|
7046
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6690
7047
|
}
|
|
6691
7048
|
this.log.debug(`Sending notification unlocked command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6692
7049
|
if (device.isLockWifi() || device.isLockWifiNoFinger()) {
|
|
6693
7050
|
await this.setAdvancedLockParams(device, types_1.PropertyName.DeviceNotificationUnlocked, value);
|
|
6694
7051
|
}
|
|
6695
7052
|
else if (device.isLockWifiR10() || device.isLockWifiR20()) {
|
|
6696
|
-
//TODO:
|
|
7053
|
+
//TODO: Implement LockWifiR10 / LockWifiR20 commnand
|
|
6697
7054
|
}
|
|
6698
7055
|
else {
|
|
6699
|
-
throw new error_1.NotSupportedError(
|
|
7056
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
6700
7057
|
}
|
|
6701
7058
|
}
|
|
6702
7059
|
async _sendLockV12P2PCommand(command, customData) {
|
|
@@ -6708,10 +7065,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6708
7065
|
name: types_1.CommandName.DeviceQueryAllUserId
|
|
6709
7066
|
};
|
|
6710
7067
|
if (device.getStationSerial() !== this.getSerial()) {
|
|
6711
|
-
throw new error_1.WrongStationError(
|
|
7068
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
6712
7069
|
}
|
|
6713
7070
|
if (!device.hasCommand(commandData.name)) {
|
|
6714
|
-
throw new error_1.NotSupportedError(
|
|
7071
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
6715
7072
|
}
|
|
6716
7073
|
this.log.debug(`Sending query all user id command to station ${this.getSerial()} for device ${device.getSerial()}`);
|
|
6717
7074
|
if (device.isLockBleNoFinger() || device.isLockBle()) {
|
|
@@ -6773,7 +7130,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6773
7130
|
});*/
|
|
6774
7131
|
}
|
|
6775
7132
|
else {
|
|
6776
|
-
throw new error_1.NotSupportedError(
|
|
7133
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
6777
7134
|
}
|
|
6778
7135
|
}
|
|
6779
7136
|
async chimeHomebase(value) {
|
|
@@ -6782,12 +7139,12 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6782
7139
|
value: value
|
|
6783
7140
|
};
|
|
6784
7141
|
if (!this.hasCommand(commandData.name)) {
|
|
6785
|
-
throw new error_1.NotSupportedError(
|
|
7142
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { commandName: commandData.name, station: this.getSerial() } });
|
|
6786
7143
|
}
|
|
6787
7144
|
if (this.rawStation.devices !== undefined) {
|
|
6788
7145
|
this.rawStation.devices.forEach((device) => {
|
|
6789
7146
|
if (device_1.Device.isDoorbell(device.device_type)) {
|
|
6790
|
-
throw new error_1.NotSupportedError(
|
|
7147
|
+
throw new error_1.NotSupportedError("This functionality is only supported on stations without registered Doorbells on it", { context: { commandName: commandData.name, station: this.getSerial() } });
|
|
6791
7148
|
}
|
|
6792
7149
|
});
|
|
6793
7150
|
}
|
|
@@ -6809,7 +7166,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6809
7166
|
});
|
|
6810
7167
|
}
|
|
6811
7168
|
else {
|
|
6812
|
-
throw new error_1.NotSupportedError(
|
|
7169
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { commandName: commandData.name, commandValue: commandData.value, station: this.getSerial() } });
|
|
6813
7170
|
}
|
|
6814
7171
|
}
|
|
6815
7172
|
onImageDownload(file, image) {
|
|
@@ -6821,7 +7178,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6821
7178
|
value: cover_path
|
|
6822
7179
|
};
|
|
6823
7180
|
if (!this.hasCommand(types_1.CommandName.StationDownloadImage)) {
|
|
6824
|
-
throw new error_1.NotSupportedError(
|
|
7181
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { commandName: commandData.name, commandValue: commandData.value, station: this.getSerial() } });
|
|
6825
7182
|
}
|
|
6826
7183
|
this.log.debug(`Sending download image command to station ${this.getSerial()} for file ${cover_path}`);
|
|
6827
7184
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
@@ -6847,7 +7204,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6847
7204
|
name: types_1.CommandName.StationDatabaseQueryLatestInfo,
|
|
6848
7205
|
};
|
|
6849
7206
|
if (!this.hasCommand(commandData.name)) {
|
|
6850
|
-
throw new error_1.NotSupportedError(
|
|
7207
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { commandName: commandData.name, station: this.getSerial() } });
|
|
6851
7208
|
}
|
|
6852
7209
|
this.log.debug(`Sending database query latest info command to station ${this.getSerial()}`);
|
|
6853
7210
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
@@ -6878,7 +7235,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6878
7235
|
}
|
|
6879
7236
|
};
|
|
6880
7237
|
if (!this.hasCommand(commandData.name)) {
|
|
6881
|
-
throw new error_1.NotSupportedError(
|
|
7238
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { commandName: commandData.name, commandValue: commandData.value, station: this.getSerial() } });
|
|
6882
7239
|
}
|
|
6883
7240
|
this.log.debug(`Sending database query local command to station ${this.getSerial()}`, { serialNumbers: serialNumbers, startDate: startDate, endDate: endDate, eventType: eventType, detectionType: detectionType, storageType: storageType });
|
|
6884
7241
|
const devices = [];
|
|
@@ -6922,7 +7279,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6922
7279
|
value: ids
|
|
6923
7280
|
};
|
|
6924
7281
|
if (!this.hasCommand(commandData.name)) {
|
|
6925
|
-
throw new error_1.NotSupportedError(
|
|
7282
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { commandName: commandData.name, commandValue: commandData.value, station: this.getSerial() } });
|
|
6926
7283
|
}
|
|
6927
7284
|
this.log.debug(`Sending database delete command to station ${this.getSerial()}`, { ids: ids });
|
|
6928
7285
|
const lids = [];
|
|
@@ -6957,7 +7314,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6957
7314
|
}
|
|
6958
7315
|
};
|
|
6959
7316
|
if (!this.hasCommand(commandData.name)) {
|
|
6960
|
-
throw new error_1.NotSupportedError(
|
|
7317
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported", { context: { commandName: commandData.name, commandValue: commandData.value, station: this.getSerial() } });
|
|
6961
7318
|
}
|
|
6962
7319
|
this.log.debug(`Sending database count by date command to station ${this.getSerial()}`, { startDate: startDate, endDate: endDate });
|
|
6963
7320
|
await this.p2pSession.sendCommandWithStringPayload({
|
|
@@ -6994,8 +7351,720 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6994
7351
|
onDatabaseDelete(returnCode, failedIds) {
|
|
6995
7352
|
this.emit("database delete", this, returnCode, failedIds);
|
|
6996
7353
|
}
|
|
7354
|
+
onSensorStatus(channel, status) {
|
|
7355
|
+
this.emit("sensor status", this, channel, status);
|
|
7356
|
+
}
|
|
7357
|
+
async setMotionDetectionTypeHuman(device, value) {
|
|
7358
|
+
const propertyData = {
|
|
7359
|
+
name: types_1.PropertyName.DeviceMotionDetectionTypeHuman,
|
|
7360
|
+
value: value
|
|
7361
|
+
};
|
|
7362
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7363
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7364
|
+
}
|
|
7365
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7366
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7367
|
+
}
|
|
7368
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7369
|
+
(0, utils_3.validValue)(property, value);
|
|
7370
|
+
this.log.debug(`Sending motion detection type human command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
7371
|
+
if (device.isWallLightCam()) {
|
|
7372
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7373
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7374
|
+
value: JSON.stringify({
|
|
7375
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_MOTION_DETECTION_TYPE_HUMAN,
|
|
7376
|
+
"data": value === true ? 1 : 0,
|
|
7377
|
+
}),
|
|
7378
|
+
channel: device.getChannel()
|
|
7379
|
+
}, {
|
|
7380
|
+
property: propertyData
|
|
7381
|
+
});
|
|
7382
|
+
}
|
|
7383
|
+
else {
|
|
7384
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7385
|
+
}
|
|
7386
|
+
}
|
|
7387
|
+
async setMotionDetectionTypeAllOtherMotions(device, value) {
|
|
7388
|
+
const propertyData = {
|
|
7389
|
+
name: types_1.PropertyName.DeviceMotionDetectionTypeAllOtherMotions,
|
|
7390
|
+
value: value
|
|
7391
|
+
};
|
|
7392
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7393
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7394
|
+
}
|
|
7395
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7396
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7397
|
+
}
|
|
7398
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7399
|
+
(0, utils_3.validValue)(property, value);
|
|
7400
|
+
this.log.debug(`Sending motion detection type all other motions command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
7401
|
+
if (device.isWallLightCam()) {
|
|
7402
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7403
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7404
|
+
value: JSON.stringify({
|
|
7405
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_MOTION_DETECTION_TYPE_ALL,
|
|
7406
|
+
"data": value === true ? 1 : 0,
|
|
7407
|
+
}),
|
|
7408
|
+
channel: device.getChannel()
|
|
7409
|
+
}, {
|
|
7410
|
+
property: propertyData
|
|
7411
|
+
});
|
|
7412
|
+
}
|
|
7413
|
+
else {
|
|
7414
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7415
|
+
}
|
|
7416
|
+
}
|
|
7417
|
+
async _setLightSettingsLightingActiveMode(device, propertyName, value, type) {
|
|
7418
|
+
const propertyData = {
|
|
7419
|
+
name: propertyName,
|
|
7420
|
+
value: value
|
|
7421
|
+
};
|
|
7422
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7423
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7424
|
+
}
|
|
7425
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7426
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7427
|
+
}
|
|
7428
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7429
|
+
(0, utils_3.validValue)(property, value);
|
|
7430
|
+
this.log.debug(`Sending light setting ${type} lighting active mode command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${JSON.stringify(value)}`);
|
|
7431
|
+
if (device.isWallLightCam()) {
|
|
7432
|
+
switch (value) {
|
|
7433
|
+
case types_1.LightingActiveMode.DAILY: {
|
|
7434
|
+
let currentProperty = types_1.PropertyName.DeviceLightSettingsManualDailyLighting;
|
|
7435
|
+
if (type === "schedule") {
|
|
7436
|
+
currentProperty = types_1.PropertyName.DeviceLightSettingsScheduleDailyLighting;
|
|
7437
|
+
}
|
|
7438
|
+
else if (type === "motion") {
|
|
7439
|
+
currentProperty = types_1.PropertyName.DeviceLightSettingsMotionDailyLighting;
|
|
7440
|
+
}
|
|
7441
|
+
let currentPropertyValue = device.getPropertyValue(currentProperty);
|
|
7442
|
+
if (!(currentPropertyValue in types_1.DailyLightingType)) {
|
|
7443
|
+
currentPropertyValue = types_1.DailyLightingType.COLD;
|
|
7444
|
+
}
|
|
7445
|
+
//TODO: Force cloud api refresh or updateProperty of currentPropertyValue?
|
|
7446
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7447
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7448
|
+
value: JSON.stringify({
|
|
7449
|
+
"commandType": type === "manual" ? types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MANUAL_DAILY_LIGHTING : type === "schedule" ? types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_SCHEDULE_DAILY_LIGHTING : types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MOTION_DAILY_LIGHTING,
|
|
7450
|
+
"data": currentPropertyValue,
|
|
7451
|
+
}),
|
|
7452
|
+
channel: device.getChannel()
|
|
7453
|
+
}, {
|
|
7454
|
+
property: propertyData,
|
|
7455
|
+
onSuccess: () => {
|
|
7456
|
+
device.updateProperty(currentProperty, currentPropertyValue);
|
|
7457
|
+
}
|
|
7458
|
+
});
|
|
7459
|
+
break;
|
|
7460
|
+
}
|
|
7461
|
+
case types_1.LightingActiveMode.COLORED: {
|
|
7462
|
+
let currentProperty = types_1.PropertyName.DeviceLightSettingsManualColoredLighting;
|
|
7463
|
+
if (type === "schedule") {
|
|
7464
|
+
currentProperty = types_1.PropertyName.DeviceLightSettingsScheduleColoredLighting;
|
|
7465
|
+
}
|
|
7466
|
+
else if (type === "motion") {
|
|
7467
|
+
currentProperty = types_1.PropertyName.DeviceLightSettingsMotionColoredLighting;
|
|
7468
|
+
}
|
|
7469
|
+
let currentPropertyValue = device.getPropertyValue(currentProperty);
|
|
7470
|
+
const colors = device.getPropertyValue(types_1.PropertyName.DeviceLightSettingsColoredLightingColors);
|
|
7471
|
+
if (!colors.some(color => color.red === currentPropertyValue.red && color.green === currentPropertyValue.green && color.blue === currentPropertyValue.blue)) {
|
|
7472
|
+
currentPropertyValue = colors[0];
|
|
7473
|
+
}
|
|
7474
|
+
//TODO: Force cloud api refresh or updateProperty of currentPropertyValue?
|
|
7475
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7476
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7477
|
+
value: JSON.stringify({
|
|
7478
|
+
"commandType": type === "manual" ? types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MANUAL_COLORED_LIGHTING : type === "schedule" ? types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_SCHEDULE_COLORED_LIGHTING : types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MOTION_COLORED_LIGHTING,
|
|
7479
|
+
"data": {
|
|
7480
|
+
"rgb_color": (0, utils_2.RGBColorToDecimal)(currentPropertyValue)
|
|
7481
|
+
},
|
|
7482
|
+
}),
|
|
7483
|
+
channel: device.getChannel()
|
|
7484
|
+
}, {
|
|
7485
|
+
property: propertyData,
|
|
7486
|
+
onSuccess: () => {
|
|
7487
|
+
device.updateProperty(currentProperty, currentPropertyValue);
|
|
7488
|
+
}
|
|
7489
|
+
});
|
|
7490
|
+
break;
|
|
7491
|
+
}
|
|
7492
|
+
case types_1.LightingActiveMode.DYNAMIC: {
|
|
7493
|
+
let currentProperty = types_1.PropertyName.DeviceLightSettingsManualDynamicLighting;
|
|
7494
|
+
if (type === "schedule") {
|
|
7495
|
+
currentProperty = types_1.PropertyName.DeviceLightSettingsScheduleDynamicLighting;
|
|
7496
|
+
}
|
|
7497
|
+
else if (type === "motion") {
|
|
7498
|
+
currentProperty = types_1.PropertyName.DeviceLightSettingsMotionDynamicLighting;
|
|
7499
|
+
}
|
|
7500
|
+
let currentPropertyValue = device.getPropertyValue(currentProperty);
|
|
7501
|
+
const range = device.getPropertyValue(types_1.PropertyName.DeviceLightSettingsDynamicLightingThemes).length;
|
|
7502
|
+
if (currentPropertyValue < 0 || currentPropertyValue >= range) {
|
|
7503
|
+
currentPropertyValue = 0;
|
|
7504
|
+
}
|
|
7505
|
+
//TODO: Force cloud api refresh or updateProperty of currentPropertyValue?
|
|
7506
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7507
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7508
|
+
value: JSON.stringify({
|
|
7509
|
+
"commandType": type === "manual" ? types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MANUAL_DYNAMIC_LIGHTING : type === "schedule" ? types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_SCHEDULE_DYNAMIC_LIGHTING : types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MOTION_DYNAMIC_LIGHTING,
|
|
7510
|
+
"data": currentPropertyValue,
|
|
7511
|
+
}),
|
|
7512
|
+
channel: device.getChannel()
|
|
7513
|
+
}, {
|
|
7514
|
+
property: propertyData,
|
|
7515
|
+
onSuccess: () => {
|
|
7516
|
+
device.updateProperty(currentProperty, currentPropertyValue);
|
|
7517
|
+
}
|
|
7518
|
+
});
|
|
7519
|
+
break;
|
|
7520
|
+
}
|
|
7521
|
+
}
|
|
7522
|
+
}
|
|
7523
|
+
else {
|
|
7524
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7525
|
+
}
|
|
7526
|
+
}
|
|
7527
|
+
async setLightSettingsManualLightingActiveMode(device, value) {
|
|
7528
|
+
await this._setLightSettingsLightingActiveMode(device, types_1.PropertyName.DeviceLightSettingsManualLightingActiveMode, value, "manual");
|
|
7529
|
+
}
|
|
7530
|
+
async setLightSettingsManualDailyLighting(device, value) {
|
|
7531
|
+
const propertyData = {
|
|
7532
|
+
name: types_1.PropertyName.DeviceLightSettingsManualDailyLighting,
|
|
7533
|
+
value: value
|
|
7534
|
+
};
|
|
7535
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7536
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7537
|
+
}
|
|
7538
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7539
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7540
|
+
}
|
|
7541
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7542
|
+
(0, utils_3.validValue)(property, value);
|
|
7543
|
+
this.log.debug(`Sending light setting manual daily lighting command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
7544
|
+
if (device.isWallLightCam()) {
|
|
7545
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7546
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7547
|
+
value: JSON.stringify({
|
|
7548
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MANUAL_DAILY_LIGHTING,
|
|
7549
|
+
"data": value,
|
|
7550
|
+
}),
|
|
7551
|
+
channel: device.getChannel()
|
|
7552
|
+
}, {
|
|
7553
|
+
property: propertyData,
|
|
7554
|
+
onSuccess: () => {
|
|
7555
|
+
device.updateProperty(types_1.PropertyName.DeviceLightSettingsManualLightingActiveMode, types_1.LightingActiveMode.DAILY);
|
|
7556
|
+
}
|
|
7557
|
+
});
|
|
7558
|
+
}
|
|
7559
|
+
else {
|
|
7560
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7561
|
+
}
|
|
7562
|
+
}
|
|
7563
|
+
async setLightSettingsManualColoredLighting(device, value) {
|
|
7564
|
+
const propertyData = {
|
|
7565
|
+
name: types_1.PropertyName.DeviceLightSettingsManualColoredLighting,
|
|
7566
|
+
value: value
|
|
7567
|
+
};
|
|
7568
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7569
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7570
|
+
}
|
|
7571
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7572
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7573
|
+
}
|
|
7574
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7575
|
+
(0, utils_3.validValue)(property, value);
|
|
7576
|
+
const colors = device.getPropertyValue(types_1.PropertyName.DeviceLightSettingsColoredLightingColors);
|
|
7577
|
+
if (!colors.some(color => color.red === value.red && color.green === value.green && color.blue === value.blue)) {
|
|
7578
|
+
throw new error_1.InvalidPropertyValueError("Invalid value for this property", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7579
|
+
}
|
|
7580
|
+
this.log.debug(`Sending light setting manual colored lighting command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${JSON.stringify(value)}`);
|
|
7581
|
+
if (device.isWallLightCam()) {
|
|
7582
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7583
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7584
|
+
value: JSON.stringify({
|
|
7585
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MANUAL_COLORED_LIGHTING,
|
|
7586
|
+
"data": {
|
|
7587
|
+
"rgb_color": (0, utils_2.RGBColorToDecimal)(value)
|
|
7588
|
+
},
|
|
7589
|
+
}),
|
|
7590
|
+
channel: device.getChannel()
|
|
7591
|
+
}, {
|
|
7592
|
+
property: propertyData,
|
|
7593
|
+
onSuccess: () => {
|
|
7594
|
+
device.updateProperty(types_1.PropertyName.DeviceLightSettingsManualLightingActiveMode, types_1.LightingActiveMode.COLORED);
|
|
7595
|
+
}
|
|
7596
|
+
});
|
|
7597
|
+
}
|
|
7598
|
+
else {
|
|
7599
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7600
|
+
}
|
|
7601
|
+
}
|
|
7602
|
+
async setLightSettingsManualDynamicLighting(device, value) {
|
|
7603
|
+
const propertyData = {
|
|
7604
|
+
name: types_1.PropertyName.DeviceLightSettingsManualDynamicLighting,
|
|
7605
|
+
value: value
|
|
7606
|
+
};
|
|
7607
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7608
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7609
|
+
}
|
|
7610
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7611
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7612
|
+
}
|
|
7613
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7614
|
+
(0, utils_3.validValue)(property, value);
|
|
7615
|
+
this.log.debug(`Sending light setting manual dynamic lighting command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
7616
|
+
if (device.isWallLightCam()) {
|
|
7617
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7618
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7619
|
+
value: JSON.stringify({
|
|
7620
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MANUAL_DYNAMIC_LIGHTING,
|
|
7621
|
+
"data": value,
|
|
7622
|
+
}),
|
|
7623
|
+
channel: device.getChannel()
|
|
7624
|
+
}, {
|
|
7625
|
+
property: propertyData,
|
|
7626
|
+
onSuccess: () => {
|
|
7627
|
+
device.updateProperty(types_1.PropertyName.DeviceLightSettingsManualLightingActiveMode, types_1.LightingActiveMode.DYNAMIC);
|
|
7628
|
+
}
|
|
7629
|
+
});
|
|
7630
|
+
}
|
|
7631
|
+
else {
|
|
7632
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7633
|
+
}
|
|
7634
|
+
}
|
|
7635
|
+
async setLightSettingsMotionLightingActiveMode(device, value) {
|
|
7636
|
+
await this._setLightSettingsLightingActiveMode(device, types_1.PropertyName.DeviceLightSettingsMotionLightingActiveMode, value, "motion");
|
|
7637
|
+
}
|
|
7638
|
+
async setLightSettingsMotionDailyLighting(device, value) {
|
|
7639
|
+
const propertyData = {
|
|
7640
|
+
name: types_1.PropertyName.DeviceLightSettingsMotionDailyLighting,
|
|
7641
|
+
value: value
|
|
7642
|
+
};
|
|
7643
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7644
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7645
|
+
}
|
|
7646
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7647
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7648
|
+
}
|
|
7649
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7650
|
+
(0, utils_3.validValue)(property, value);
|
|
7651
|
+
this.log.debug(`Sending light setting motion daily lighting command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
7652
|
+
if (device.isWallLightCam()) {
|
|
7653
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7654
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7655
|
+
value: JSON.stringify({
|
|
7656
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MOTION_DAILY_LIGHTING,
|
|
7657
|
+
"data": value,
|
|
7658
|
+
}),
|
|
7659
|
+
channel: device.getChannel()
|
|
7660
|
+
}, {
|
|
7661
|
+
property: propertyData,
|
|
7662
|
+
onSuccess: () => {
|
|
7663
|
+
device.updateProperty(types_1.PropertyName.DeviceLightSettingsMotionActivationMode, types_1.LightingActiveMode.DAILY);
|
|
7664
|
+
}
|
|
7665
|
+
});
|
|
7666
|
+
}
|
|
7667
|
+
else {
|
|
7668
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7669
|
+
}
|
|
7670
|
+
}
|
|
7671
|
+
async setLightSettingsMotionColoredLighting(device, value) {
|
|
7672
|
+
const propertyData = {
|
|
7673
|
+
name: types_1.PropertyName.DeviceLightSettingsMotionColoredLighting,
|
|
7674
|
+
value: value
|
|
7675
|
+
};
|
|
7676
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7677
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7678
|
+
}
|
|
7679
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7680
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7681
|
+
}
|
|
7682
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7683
|
+
(0, utils_3.validValue)(property, value);
|
|
7684
|
+
const colors = device.getPropertyValue(types_1.PropertyName.DeviceLightSettingsColoredLightingColors);
|
|
7685
|
+
if (!colors.some(color => color.red === value.red && color.green === value.green && color.blue === value.blue)) {
|
|
7686
|
+
throw new error_1.InvalidPropertyValueError("Invalid value for this property", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7687
|
+
}
|
|
7688
|
+
this.log.debug(`Sending light setting motion colored lighting command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${JSON.stringify(value)}`);
|
|
7689
|
+
if (device.isWallLightCam()) {
|
|
7690
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7691
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7692
|
+
value: JSON.stringify({
|
|
7693
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MOTION_COLORED_LIGHTING,
|
|
7694
|
+
"data": {
|
|
7695
|
+
"rgb_color": (0, utils_2.RGBColorToDecimal)(value)
|
|
7696
|
+
},
|
|
7697
|
+
}),
|
|
7698
|
+
channel: device.getChannel()
|
|
7699
|
+
}, {
|
|
7700
|
+
property: propertyData,
|
|
7701
|
+
onSuccess: () => {
|
|
7702
|
+
device.updateProperty(types_1.PropertyName.DeviceLightSettingsMotionActivationMode, types_1.LightingActiveMode.COLORED);
|
|
7703
|
+
}
|
|
7704
|
+
});
|
|
7705
|
+
}
|
|
7706
|
+
else {
|
|
7707
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7708
|
+
}
|
|
7709
|
+
}
|
|
7710
|
+
async setLightSettingsMotionDynamicLighting(device, value) {
|
|
7711
|
+
const propertyData = {
|
|
7712
|
+
name: types_1.PropertyName.DeviceLightSettingsMotionDynamicLighting,
|
|
7713
|
+
value: value
|
|
7714
|
+
};
|
|
7715
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7716
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7717
|
+
}
|
|
7718
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7719
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7720
|
+
}
|
|
7721
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7722
|
+
(0, utils_3.validValue)(property, value);
|
|
7723
|
+
this.log.debug(`Sending light setting motion dynamic lighting command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
7724
|
+
if (device.isWallLightCam()) {
|
|
7725
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7726
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7727
|
+
value: JSON.stringify({
|
|
7728
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_MOTION_DYNAMIC_LIGHTING,
|
|
7729
|
+
"data": value,
|
|
7730
|
+
}),
|
|
7731
|
+
channel: device.getChannel()
|
|
7732
|
+
}, {
|
|
7733
|
+
property: propertyData,
|
|
7734
|
+
onSuccess: () => {
|
|
7735
|
+
device.updateProperty(types_1.PropertyName.DeviceLightSettingsMotionActivationMode, types_1.LightingActiveMode.DYNAMIC);
|
|
7736
|
+
}
|
|
7737
|
+
});
|
|
7738
|
+
}
|
|
7739
|
+
else {
|
|
7740
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7741
|
+
}
|
|
7742
|
+
}
|
|
7743
|
+
async setLightSettingsScheduleLightingActiveMode(device, value) {
|
|
7744
|
+
await this._setLightSettingsLightingActiveMode(device, types_1.PropertyName.DeviceLightSettingsScheduleLightingActiveMode, value, "schedule");
|
|
7745
|
+
}
|
|
7746
|
+
async setLightSettingsScheduleDailyLighting(device, value) {
|
|
7747
|
+
const propertyData = {
|
|
7748
|
+
name: types_1.PropertyName.DeviceLightSettingsScheduleDailyLighting,
|
|
7749
|
+
value: value
|
|
7750
|
+
};
|
|
7751
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7752
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7753
|
+
}
|
|
7754
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7755
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7756
|
+
}
|
|
7757
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7758
|
+
(0, utils_3.validValue)(property, value);
|
|
7759
|
+
this.log.debug(`Sending light setting schedule daily lighting command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
7760
|
+
if (device.isWallLightCam()) {
|
|
7761
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7762
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7763
|
+
value: JSON.stringify({
|
|
7764
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_SCHEDULE_DAILY_LIGHTING,
|
|
7765
|
+
"data": value,
|
|
7766
|
+
}),
|
|
7767
|
+
channel: device.getChannel()
|
|
7768
|
+
}, {
|
|
7769
|
+
property: propertyData,
|
|
7770
|
+
onSuccess: () => {
|
|
7771
|
+
device.updateProperty(types_1.PropertyName.DeviceLightSettingsScheduleLightingActiveMode, types_1.LightingActiveMode.DAILY);
|
|
7772
|
+
}
|
|
7773
|
+
});
|
|
7774
|
+
}
|
|
7775
|
+
else {
|
|
7776
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7777
|
+
}
|
|
7778
|
+
}
|
|
7779
|
+
async setLightSettingsScheduleColoredLighting(device, value) {
|
|
7780
|
+
const propertyData = {
|
|
7781
|
+
name: types_1.PropertyName.DeviceLightSettingsScheduleColoredLighting,
|
|
7782
|
+
value: value
|
|
7783
|
+
};
|
|
7784
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7785
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7786
|
+
}
|
|
7787
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7788
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7789
|
+
}
|
|
7790
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7791
|
+
(0, utils_3.validValue)(property, value);
|
|
7792
|
+
const colors = device.getPropertyValue(types_1.PropertyName.DeviceLightSettingsColoredLightingColors);
|
|
7793
|
+
if (!colors.some(color => color.red === value.red && color.green === value.green && color.blue === value.blue)) {
|
|
7794
|
+
throw new error_1.InvalidPropertyValueError("Invalid value for this property", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7795
|
+
}
|
|
7796
|
+
this.log.debug(`Sending light setting schedule colored lighting command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${JSON.stringify(value)}`);
|
|
7797
|
+
if (device.isWallLightCam()) {
|
|
7798
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7799
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7800
|
+
value: JSON.stringify({
|
|
7801
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_SCHEDULE_COLORED_LIGHTING,
|
|
7802
|
+
"data": {
|
|
7803
|
+
"rgb_color": (0, utils_2.RGBColorToDecimal)(value)
|
|
7804
|
+
},
|
|
7805
|
+
}),
|
|
7806
|
+
channel: device.getChannel()
|
|
7807
|
+
}, {
|
|
7808
|
+
property: propertyData,
|
|
7809
|
+
onSuccess: () => {
|
|
7810
|
+
device.updateProperty(types_1.PropertyName.DeviceLightSettingsScheduleLightingActiveMode, types_1.LightingActiveMode.COLORED);
|
|
7811
|
+
}
|
|
7812
|
+
});
|
|
7813
|
+
}
|
|
7814
|
+
else {
|
|
7815
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7816
|
+
}
|
|
7817
|
+
}
|
|
7818
|
+
async setLightSettingsScheduleDynamicLighting(device, value) {
|
|
7819
|
+
const propertyData = {
|
|
7820
|
+
name: types_1.PropertyName.DeviceLightSettingsScheduleDynamicLighting,
|
|
7821
|
+
value: value
|
|
7822
|
+
};
|
|
7823
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7824
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7825
|
+
}
|
|
7826
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7827
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7828
|
+
}
|
|
7829
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7830
|
+
(0, utils_3.validValue)(property, value);
|
|
7831
|
+
this.log.debug(`Sending light setting schedule dynamic lighting command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
7832
|
+
if (device.isWallLightCam()) {
|
|
7833
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7834
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7835
|
+
value: JSON.stringify({
|
|
7836
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_SCHEDULE_DYNAMIC_LIGHTING,
|
|
7837
|
+
"data": value,
|
|
7838
|
+
}),
|
|
7839
|
+
channel: device.getChannel()
|
|
7840
|
+
}, {
|
|
7841
|
+
property: propertyData,
|
|
7842
|
+
onSuccess: () => {
|
|
7843
|
+
device.updateProperty(types_1.PropertyName.DeviceLightSettingsScheduleLightingActiveMode, types_1.LightingActiveMode.DYNAMIC);
|
|
7844
|
+
}
|
|
7845
|
+
});
|
|
7846
|
+
}
|
|
7847
|
+
else {
|
|
7848
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7849
|
+
}
|
|
7850
|
+
}
|
|
7851
|
+
async setLightSettingsColoredLightingColors(device, value) {
|
|
7852
|
+
const propertyData = {
|
|
7853
|
+
name: types_1.PropertyName.DeviceLightSettingsColoredLightingColors,
|
|
7854
|
+
value: value
|
|
7855
|
+
};
|
|
7856
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7857
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7858
|
+
}
|
|
7859
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7860
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7861
|
+
}
|
|
7862
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7863
|
+
(0, utils_3.validValue)(property, value);
|
|
7864
|
+
this.log.debug(`Sending light setting colored lighting colors command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${JSON.stringify(value)}`);
|
|
7865
|
+
if (device.isWallLightCam()) {
|
|
7866
|
+
const colors = [{ "color": 16760832 }, { "color": 16744448 }, { "color": 16728320 }, { "color": 16720384 }, { "color": 16711696 }, { "color": 3927961 }, { "color": 1568995 }, { "color": 485368 }, { "color": 9983 }, { "color": 4664060 }];
|
|
7867
|
+
if (value.length > 0 && value.length <= 15) {
|
|
7868
|
+
let count = 0;
|
|
7869
|
+
for (let i = 0; i < colors.length; i++) {
|
|
7870
|
+
if ((0, utils_2.RGBColorToDecimal)(value[i]) === colors[i].color) {
|
|
7871
|
+
count++;
|
|
7872
|
+
}
|
|
7873
|
+
else {
|
|
7874
|
+
break;
|
|
7875
|
+
}
|
|
7876
|
+
}
|
|
7877
|
+
if (value.length - count + colors.length > 15) {
|
|
7878
|
+
throw new error_1.InvalidPropertyValueError("This property can contain a maximum of 15 items, of which the first 10 are fixed. You can either deliver the first 10 static items with the maximum 5 freely selectable items or only the maximum 5 freely selectable items.", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7879
|
+
}
|
|
7880
|
+
else {
|
|
7881
|
+
for (let i = count; i < value.length - count + 10; i++) {
|
|
7882
|
+
colors.push({ color: (0, utils_2.RGBColorToDecimal)(value[i]) });
|
|
7883
|
+
}
|
|
7884
|
+
}
|
|
7885
|
+
}
|
|
7886
|
+
else {
|
|
7887
|
+
throw new error_1.InvalidPropertyValueError("This property can contain a maximum of 15 items, of which the first 10 are fixed. You can either deliver the first 10 static items with the maximum 5 freely selectable items or only the maximum 5 freely selectable items.", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7888
|
+
}
|
|
7889
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7890
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7891
|
+
value: JSON.stringify({
|
|
7892
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_COLORED_LIGHTING_COLORS,
|
|
7893
|
+
"data": colors,
|
|
7894
|
+
}),
|
|
7895
|
+
channel: device.getChannel()
|
|
7896
|
+
}, {
|
|
7897
|
+
property: propertyData
|
|
7898
|
+
});
|
|
7899
|
+
}
|
|
7900
|
+
else {
|
|
7901
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7902
|
+
}
|
|
7903
|
+
}
|
|
7904
|
+
async setLightSettingsDynamicLightingThemes(device, value) {
|
|
7905
|
+
const propertyData = {
|
|
7906
|
+
name: types_1.PropertyName.DeviceLightSettingsDynamicLightingThemes,
|
|
7907
|
+
value: value
|
|
7908
|
+
};
|
|
7909
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7910
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7911
|
+
}
|
|
7912
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7913
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7914
|
+
}
|
|
7915
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7916
|
+
(0, utils_3.validValue)(property, value);
|
|
7917
|
+
this.log.debug(`Sending light setting dynamic lighting themes command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${JSON.stringify(value)}`);
|
|
7918
|
+
if (device.isWallLightCam()) {
|
|
7919
|
+
const themes = [{ "name": "Aurora", "mode": 1, "id": 0, "speed": 4000, "colors": [65321, 65468, 28671, 9215, 42239] }, { "name": "Warmth", "mode": 1, "id": 1, "speed": 4000, "colors": [16758528, 16744448, 16732160, 16719360, 16742144] }, { "name": "Let's Party", "mode": 2, "id": 2, "speed": 500, "colors": [16718080, 16756736, 65298, 40703, 4980991] }];
|
|
7920
|
+
if (value.length > 0 && value.length <= 23) {
|
|
7921
|
+
let count = 0;
|
|
7922
|
+
for (let i = 0; i < themes.length; i++) {
|
|
7923
|
+
if (value[i].name === themes[i].name) {
|
|
7924
|
+
count++;
|
|
7925
|
+
}
|
|
7926
|
+
else {
|
|
7927
|
+
break;
|
|
7928
|
+
}
|
|
7929
|
+
}
|
|
7930
|
+
if (value.length - count + themes.length > 23) {
|
|
7931
|
+
throw new error_1.InvalidPropertyValueError("This property can contain a maximum of 23 items, of which the first 3 are fixed. You can either deliver the first 3 static items with the maximum 20 freely selectable items or only the maximum 20 freely selectable items.", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7932
|
+
}
|
|
7933
|
+
else {
|
|
7934
|
+
for (let i = count; i < value.length - count + 3; i++) {
|
|
7935
|
+
themes.push({
|
|
7936
|
+
id: i,
|
|
7937
|
+
colors: value[i].colors.map((color) => (0, utils_2.RGBColorToDecimal)(color)),
|
|
7938
|
+
mode: value[i].mode,
|
|
7939
|
+
name: value[i].name,
|
|
7940
|
+
speed: value[i].speed
|
|
7941
|
+
});
|
|
7942
|
+
}
|
|
7943
|
+
}
|
|
7944
|
+
}
|
|
7945
|
+
else {
|
|
7946
|
+
throw new error_1.InvalidPropertyValueError("This property can contain a maximum of 23 items, of which the first 3 are fixed. You can either deliver the first 3 static items with the maximum 20 freely selectable items or only the maximum 20 freely selectable items.", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7947
|
+
}
|
|
7948
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7949
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7950
|
+
value: JSON.stringify({
|
|
7951
|
+
"commandType": types_2.CommandType.CMD_WALL_LIGHT_SETTINGS_DYNAMIC_LIGHTING_THEMES,
|
|
7952
|
+
"data": themes,
|
|
7953
|
+
}),
|
|
7954
|
+
channel: device.getChannel()
|
|
7955
|
+
}, {
|
|
7956
|
+
property: propertyData
|
|
7957
|
+
});
|
|
7958
|
+
}
|
|
7959
|
+
else {
|
|
7960
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7961
|
+
}
|
|
7962
|
+
}
|
|
7963
|
+
async setDoorControlWarning(device, value) {
|
|
7964
|
+
const propertyData = {
|
|
7965
|
+
name: types_1.PropertyName.DeviceDoorControlWarning,
|
|
7966
|
+
value: value
|
|
7967
|
+
};
|
|
7968
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
7969
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7970
|
+
}
|
|
7971
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
7972
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7973
|
+
}
|
|
7974
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
7975
|
+
(0, utils_3.validValue)(property, value);
|
|
7976
|
+
this.log.debug(`Sending door control warning command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
|
|
7977
|
+
if (device.isGarageCamera()) {
|
|
7978
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
7979
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
7980
|
+
value: JSON.stringify({
|
|
7981
|
+
"commandType": types_2.CommandType.CMD_CAMERA_GARAGE_DOOR_CONTROL_WARNING,
|
|
7982
|
+
"data": {
|
|
7983
|
+
"doorid": 1,
|
|
7984
|
+
"value": value === true ? 1 : 0,
|
|
7985
|
+
},
|
|
7986
|
+
}),
|
|
7987
|
+
channel: device.getChannel()
|
|
7988
|
+
}, {
|
|
7989
|
+
property: propertyData
|
|
7990
|
+
});
|
|
7991
|
+
}
|
|
7992
|
+
else {
|
|
7993
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
7994
|
+
}
|
|
7995
|
+
}
|
|
7996
|
+
async openDoor(device, value, doorId = 1) {
|
|
7997
|
+
const propertyData = {
|
|
7998
|
+
name: doorId === 1 ? types_1.PropertyName.DeviceDoor1Open : types_1.PropertyName.DeviceDoor2Open,
|
|
7999
|
+
value: {
|
|
8000
|
+
value: value,
|
|
8001
|
+
doorId: doorId
|
|
8002
|
+
}
|
|
8003
|
+
};
|
|
8004
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
8005
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
8006
|
+
}
|
|
8007
|
+
if (!device.hasProperty(propertyData.name)) {
|
|
8008
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
8009
|
+
}
|
|
8010
|
+
const property = device.getPropertyMetadata(propertyData.name);
|
|
8011
|
+
(0, utils_3.validValue)(property, value);
|
|
8012
|
+
this.log.debug(`Sending open door command to station ${this.getSerial()} for device ${device.getSerial()} doorId ${doorId} with value: ${value}`);
|
|
8013
|
+
if (device.isGarageCamera()) {
|
|
8014
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
8015
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
8016
|
+
value: JSON.stringify({
|
|
8017
|
+
"commandType": types_2.CommandType.CMD_CAMERA_GARAGE_DOOR_STATUS,
|
|
8018
|
+
"data": {
|
|
8019
|
+
"cmdType": 0,
|
|
8020
|
+
"disable_push": 0,
|
|
8021
|
+
"source": 0,
|
|
8022
|
+
"type": doorId === 1 ? (value === true ? 1 : 0) : (value === true ? 3 : 2),
|
|
8023
|
+
"user_name": this.rawStation.member.nick_name,
|
|
8024
|
+
},
|
|
8025
|
+
}),
|
|
8026
|
+
channel: device.getChannel()
|
|
8027
|
+
}, {
|
|
8028
|
+
property: propertyData
|
|
8029
|
+
});
|
|
8030
|
+
}
|
|
8031
|
+
else {
|
|
8032
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), propertyName: propertyData.name, propertyValue: propertyData.value } });
|
|
8033
|
+
}
|
|
8034
|
+
}
|
|
8035
|
+
onGarageDoorStatus(channel, doorId, status) {
|
|
8036
|
+
this.emit("garage door status", this, channel, doorId, status);
|
|
8037
|
+
}
|
|
8038
|
+
async calibrateGarageDoor(device, doorId, type) {
|
|
8039
|
+
const commandData = {
|
|
8040
|
+
name: types_1.CommandName.DeviceCalibrateGarageDoor
|
|
8041
|
+
};
|
|
8042
|
+
if (device.getStationSerial() !== this.getSerial()) {
|
|
8043
|
+
throw new error_1.WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
8044
|
+
}
|
|
8045
|
+
if (!device.hasCommand(types_1.CommandName.DeviceCalibrateGarageDoor)) {
|
|
8046
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
8047
|
+
}
|
|
8048
|
+
this.log.debug(`Sending calibrate garage door command to station ${this.getSerial()} for device ${device.getSerial()} doorId ${doorId} type ${types_2.CalibrateGarageType[type]}`);
|
|
8049
|
+
if (device.isGarageCamera()) {
|
|
8050
|
+
await this.p2pSession.sendCommandWithStringPayload({
|
|
8051
|
+
commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
|
|
8052
|
+
value: JSON.stringify({
|
|
8053
|
+
"commandType": types_2.CommandType.CMD_CAMERA_GARAGE_DOOR_CALIBRATE,
|
|
8054
|
+
"data": {
|
|
8055
|
+
"door_id": doorId,
|
|
8056
|
+
"type": type
|
|
8057
|
+
}
|
|
8058
|
+
}),
|
|
8059
|
+
channel: device.getChannel()
|
|
8060
|
+
}, {
|
|
8061
|
+
command: commandData
|
|
8062
|
+
});
|
|
8063
|
+
}
|
|
8064
|
+
else {
|
|
8065
|
+
throw new error_1.NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name } });
|
|
8066
|
+
}
|
|
8067
|
+
}
|
|
6997
8068
|
}
|
|
6998
|
-
Station.CHANNEL = 255;
|
|
6999
|
-
Station.CHANNEL_INDOOR = 1000;
|
|
7000
8069
|
exports.Station = Station;
|
|
7001
8070
|
//# sourceMappingURL=station.js.map
|