eufy-security-client 2.1.0 → 2.2.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/build/error.d.ts +3 -6
- package/build/error.js +9 -17
- package/build/error.js.map +1 -1
- package/build/eufysecurity.d.ts +19 -0
- package/build/eufysecurity.js +211 -76
- package/build/eufysecurity.js.map +1 -1
- package/build/http/api.js +5 -5
- package/build/http/api.js.map +1 -1
- package/build/http/device.d.ts +49 -4
- package/build/http/device.js +589 -177
- package/build/http/device.js.map +1 -1
- package/build/http/interfaces.d.ts +20 -1
- package/build/http/models.d.ts +15 -0
- package/build/http/parameter.js +13 -2
- package/build/http/parameter.js.map +1 -1
- package/build/http/station.d.ts +16 -1
- package/build/http/station.js +337 -50
- package/build/http/station.js.map +1 -1
- package/build/http/types.d.ts +125 -31
- package/build/http/types.js +713 -91
- package/build/http/types.js.map +1 -1
- package/build/http/utils.d.ts +12 -0
- package/build/http/utils.js +68 -1
- package/build/http/utils.js.map +1 -1
- package/build/interfaces.d.ts +14 -1
- package/build/p2p/index.d.ts +4 -4
- package/build/p2p/index.js +19 -17
- package/build/p2p/index.js.map +1 -1
- package/build/p2p/interfaces.d.ts +8 -2
- package/build/p2p/models.d.ts +20 -1
- package/build/p2p/session.d.ts +14 -7
- package/build/p2p/session.js +187 -57
- package/build/p2p/session.js.map +1 -1
- package/build/p2p/types.d.ts +103 -2
- package/build/p2p/types.js +107 -1
- package/build/p2p/types.js.map +1 -1
- package/build/p2p/utils.d.ts +3 -1
- package/build/p2p/utils.js +35 -4
- package/build/p2p/utils.js.map +1 -1
- package/build/push/client.js +1 -1
- package/build/push/client.js.map +1 -1
- package/build/push/index.d.ts +3 -3
- package/build/push/index.js +4 -1
- package/build/push/index.js.map +1 -1
- package/build/push/models.d.ts +19 -1
- package/build/push/models.js.map +1 -1
- package/build/push/service.js +37 -1
- package/build/push/service.js.map +1 -1
- package/build/push/types.d.ts +19 -1
- package/build/push/types.js +20 -1
- package/build/push/types.js.map +1 -1
- package/package.json +12 -9
package/README.md
CHANGED
|
@@ -80,6 +80,33 @@ Please use GitHub issues for this.
|
|
|
80
80
|
|
|
81
81
|
## Changelog
|
|
82
82
|
|
|
83
|
+
### 2.2.0-rc.1 (2022-08-19)
|
|
84
|
+
|
|
85
|
+
* (bropat) **Breaking Change** Renamed all lock settings parameters according to standard
|
|
86
|
+
* (bropat) Renewed p2p device address discovery (now also includes local discovery via broadcast; cloud discovery optimised)
|
|
87
|
+
* (bropat) Added support for Doorbell Dual notification types (package delivered, package taken, package stranded, someone loitering, radar motion detected)
|
|
88
|
+
* (bropat) Added Smart Safe support (tested only T7401; #182 **WIP**)
|
|
89
|
+
* (thieren) Added station event for connection timeout (#202)
|
|
90
|
+
* (bropat) Fixed issue #196
|
|
91
|
+
* (bropat) Fixed issue #201
|
|
92
|
+
* (bropat) Fixed emitting of event "locked" for lock devices
|
|
93
|
+
* (bropat) Small bugfixes and optimizations
|
|
94
|
+
|
|
95
|
+
### 2.1.2 (2022-07-30)
|
|
96
|
+
|
|
97
|
+
* (Palmke) Dual Doorbell family detection (#177)
|
|
98
|
+
* (Palmke) Fixed issue #187
|
|
99
|
+
* (bropat) Fixed issue #186
|
|
100
|
+
|
|
101
|
+
### 2.1.1 (2022-07-16)
|
|
102
|
+
|
|
103
|
+
* (Palmke) Add alarm arm delay event (#180)
|
|
104
|
+
* (thieren) Fix: stream command for T8420 (#171)
|
|
105
|
+
* (Palmke) Don't send the alarm armed p2p events as alarm events (#169)
|
|
106
|
+
* (bropat) Fixed issue #167
|
|
107
|
+
* (bropat) Fixed issue #161
|
|
108
|
+
* (bropat) Updated versions of the package dependencies
|
|
109
|
+
|
|
83
110
|
### 2.1.0 (2022-06-12)
|
|
84
111
|
|
|
85
112
|
* (bropat) Added toggle for Spotlight for Outdoor Cam Pro (T8441; #123)
|
package/build/error.d.ts
CHANGED
|
@@ -7,15 +7,9 @@ export declare class InvalidLanguageCodeError extends Error {
|
|
|
7
7
|
export declare class StationNotFoundError extends Error {
|
|
8
8
|
constructor(message?: string);
|
|
9
9
|
}
|
|
10
|
-
export declare class DuplicateStationError extends Error {
|
|
11
|
-
constructor(message?: string);
|
|
12
|
-
}
|
|
13
10
|
export declare class DeviceNotFoundError extends Error {
|
|
14
11
|
constructor(message?: string);
|
|
15
12
|
}
|
|
16
|
-
export declare class DuplicateDeviceError extends Error {
|
|
17
|
-
constructor(message?: string);
|
|
18
|
-
}
|
|
19
13
|
export declare class NotSupportedError extends Error {
|
|
20
14
|
constructor(message?: string);
|
|
21
15
|
}
|
|
@@ -40,3 +34,6 @@ export declare class LivestreamError extends Error {
|
|
|
40
34
|
export declare class TalkbackError extends Error {
|
|
41
35
|
constructor(message?: string);
|
|
42
36
|
}
|
|
37
|
+
export declare class StationConnectTimeoutError extends Error {
|
|
38
|
+
constructor(message?: string);
|
|
39
|
+
}
|
package/build/error.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TalkbackError = exports.LivestreamError = exports.ReadOnlyPropertyError = exports.InvalidCommandValueError = exports.InvalidPropertyValueError = exports.RTSPPropertyNotEnabled = exports.WrongStationError = exports.NotSupportedError = exports.
|
|
3
|
+
exports.StationConnectTimeoutError = exports.TalkbackError = exports.LivestreamError = exports.ReadOnlyPropertyError = exports.InvalidCommandValueError = exports.InvalidPropertyValueError = exports.RTSPPropertyNotEnabled = exports.WrongStationError = exports.NotSupportedError = exports.DeviceNotFoundError = exports.StationNotFoundError = exports.InvalidLanguageCodeError = exports.InvalidCountryCodeError = void 0;
|
|
4
4
|
class InvalidCountryCodeError extends Error {
|
|
5
5
|
constructor(message) {
|
|
6
6
|
super(message);
|
|
@@ -25,14 +25,6 @@ class StationNotFoundError extends Error {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
exports.StationNotFoundError = StationNotFoundError;
|
|
28
|
-
class DuplicateStationError extends Error {
|
|
29
|
-
constructor(message) {
|
|
30
|
-
super(message);
|
|
31
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
32
|
-
this.name = DuplicateStationError.name;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.DuplicateStationError = DuplicateStationError;
|
|
36
28
|
class DeviceNotFoundError extends Error {
|
|
37
29
|
constructor(message) {
|
|
38
30
|
super(message);
|
|
@@ -41,14 +33,6 @@ class DeviceNotFoundError extends Error {
|
|
|
41
33
|
}
|
|
42
34
|
}
|
|
43
35
|
exports.DeviceNotFoundError = DeviceNotFoundError;
|
|
44
|
-
class DuplicateDeviceError extends Error {
|
|
45
|
-
constructor(message) {
|
|
46
|
-
super(message);
|
|
47
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
-
this.name = DuplicateDeviceError.name;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.DuplicateDeviceError = DuplicateDeviceError;
|
|
52
36
|
class NotSupportedError extends Error {
|
|
53
37
|
constructor(message) {
|
|
54
38
|
super(message);
|
|
@@ -113,4 +97,12 @@ class TalkbackError extends Error {
|
|
|
113
97
|
}
|
|
114
98
|
}
|
|
115
99
|
exports.TalkbackError = TalkbackError;
|
|
100
|
+
class StationConnectTimeoutError extends Error {
|
|
101
|
+
constructor(message) {
|
|
102
|
+
super(message);
|
|
103
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
104
|
+
this.name = StationConnectTimeoutError.name;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.StationConnectTimeoutError = StationConnectTimeoutError;
|
|
116
108
|
//# sourceMappingURL=error.js.map
|
package/build/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;AACA,MAAa,uBAAwB,SAAQ,KAAK;IAC9C,YAAY,OAAgB;QACxB,KAAK,CAAC,OAAO,CA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OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;IACnC,CAAC;CACJ;AAND,sCAMC;AAED,MAAa,0BAA2B,SAAQ,KAAK;IACjD,YAAY,OAAgB;QACxB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC,IAAI,CAAC;IAChD,CAAC;CACJ;AAND,gEAMC"}
|
package/build/eufysecurity.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
|
|
|
53
53
|
private handleHouses;
|
|
54
54
|
private handleHubs;
|
|
55
55
|
private onStationConnect;
|
|
56
|
+
private onStationConnectionError;
|
|
56
57
|
private onStationClose;
|
|
57
58
|
private handleDevices;
|
|
58
59
|
refreshCloudData(): Promise<void>;
|
|
@@ -92,6 +93,7 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
|
|
|
92
93
|
private onStationStartDownload;
|
|
93
94
|
private onStationFinishDownload;
|
|
94
95
|
private onStationCommandResult;
|
|
96
|
+
private onStationSecondaryCommandResult;
|
|
95
97
|
private onStationRtspUrl;
|
|
96
98
|
private onStationGuardMode;
|
|
97
99
|
private onStationCurrentMode;
|
|
@@ -99,6 +101,7 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
|
|
|
99
101
|
private onStationRawPropertyChanged;
|
|
100
102
|
private onStationAlarmEvent;
|
|
101
103
|
private onStationAlarmDelayEvent;
|
|
104
|
+
private onStationArmDelayEvent;
|
|
102
105
|
private onStationAlarmArmedEvent;
|
|
103
106
|
private onDevicePropertyChanged;
|
|
104
107
|
private onDeviceRawPropertyChanged;
|
|
@@ -110,6 +113,17 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
|
|
|
110
113
|
private onDeviceRings;
|
|
111
114
|
private onDeviceLocked;
|
|
112
115
|
private onDeviceOpen;
|
|
116
|
+
private onDevicePackageDelivered;
|
|
117
|
+
private onDevicePackageStranded;
|
|
118
|
+
private onDevicePackageTaken;
|
|
119
|
+
private onDeviceSomeoneLoitering;
|
|
120
|
+
private onDeviceRadarMotionDetected;
|
|
121
|
+
private onDevice911Alarm;
|
|
122
|
+
private onDeviceShakeAlarm;
|
|
123
|
+
private onDeviceWrongTryProtectAlarm;
|
|
124
|
+
private onDeviceLongTimeNotClose;
|
|
125
|
+
private onDeviceLowBattery;
|
|
126
|
+
private onDeviceJammed;
|
|
113
127
|
private onDeviceReady;
|
|
114
128
|
private onStationRuntimeState;
|
|
115
129
|
private onStationChargingState;
|
|
@@ -123,4 +137,9 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
|
|
|
123
137
|
private onStationTalkbackError;
|
|
124
138
|
startStationTalkback(deviceSN: string): Promise<void>;
|
|
125
139
|
stopStationTalkback(deviceSN: string): Promise<void>;
|
|
140
|
+
private onStationDeviceShakeAlarm;
|
|
141
|
+
private onStationDevice911Alarm;
|
|
142
|
+
private onStationDeviceJammed;
|
|
143
|
+
private onStationDeviceLowBattery;
|
|
144
|
+
private onStationDeviceWrongTryProtectAlarm;
|
|
126
145
|
}
|
package/build/eufysecurity.js
CHANGED
|
@@ -190,7 +190,7 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
190
190
|
});
|
|
191
191
|
this.mqttService.on("lock message", (message) => {
|
|
192
192
|
this.getDevice(message.data.data.deviceSn).then((device) => {
|
|
193
|
-
device.processMQTTNotification(message.data.data);
|
|
193
|
+
device.processMQTTNotification(message.data.data, this.config.eventDurationSeconds);
|
|
194
194
|
}).catch((error) => {
|
|
195
195
|
if (error instanceof error_1.DeviceNotFoundError) {
|
|
196
196
|
}
|
|
@@ -212,7 +212,7 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
212
212
|
this.emit("station added", station);
|
|
213
213
|
}
|
|
214
214
|
else {
|
|
215
|
-
|
|
215
|
+
this.log.debug(`Station with this serial ${station.getSerial()} exists already and couldn't be added again!`);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
removeStation(station) {
|
|
@@ -225,7 +225,7 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
225
225
|
this.emit("station removed", station);
|
|
226
226
|
}
|
|
227
227
|
else {
|
|
228
|
-
|
|
228
|
+
this.log.debug(`Station with this serial ${station.getSerial()} doesn't exists and couldn't be removed!`);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
updateStation(hub) {
|
|
@@ -237,7 +237,7 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
else {
|
|
240
|
-
|
|
240
|
+
this.log.debug(`Station with this serial ${hub.station_sn} doesn't exists and couldn't be updated!`);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
addDevice(device) {
|
|
@@ -249,7 +249,7 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
249
249
|
this.mqttService.subscribeLock(device.getSerial());
|
|
250
250
|
}
|
|
251
251
|
else {
|
|
252
|
-
|
|
252
|
+
this.log.debug(`Device with this serial ${device.getSerial()} exists already and couldn't be added again!`);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
removeDevice(device) {
|
|
@@ -260,7 +260,7 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
260
260
|
this.emit("device removed", device);
|
|
261
261
|
}
|
|
262
262
|
else {
|
|
263
|
-
|
|
263
|
+
this.log.debug(`Device with this serial ${device.getSerial()} doesn't exists and couldn't be removed!`);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
async updateDevice(device) {
|
|
@@ -269,7 +269,7 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
269
269
|
if (Object.keys(this.devices).includes(device.device_sn))
|
|
270
270
|
this.devices[device.device_sn].update(device, this.stations[device.station_sn] !== undefined && !this.stations[device.station_sn].isIntegratedDevice() && this.stations[device.station_sn].isConnected());
|
|
271
271
|
else
|
|
272
|
-
|
|
272
|
+
this.log.debug(`Device with this serial ${device.device_sn} doesn't exists and couldn't be updated!`);
|
|
273
273
|
}
|
|
274
274
|
async getDevices() {
|
|
275
275
|
if (this.loadingDevices !== undefined)
|
|
@@ -313,22 +313,17 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
313
313
|
return this.api;
|
|
314
314
|
}
|
|
315
315
|
async connectToStation(stationSN, p2pConnectionType = types_2.P2PConnectionType.QUICKEST) {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
else
|
|
321
|
-
throw new error_1.StationNotFoundError(`No station with this serial number: ${stationSN}!`);
|
|
316
|
+
const station = this.getStation(stationSN);
|
|
317
|
+
station.setConnectionType(p2pConnectionType);
|
|
318
|
+
station.connect();
|
|
322
319
|
}
|
|
323
320
|
isStationConnected(stationSN) {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
throw new error_1.StationNotFoundError(`No station with this serial number: ${stationSN}!`);
|
|
321
|
+
const station = this.getStation(stationSN);
|
|
322
|
+
return station.isConnected();
|
|
327
323
|
}
|
|
328
324
|
isStationEnergySavingDevice(stationSN) {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
throw new error_1.StationNotFoundError(`No station with this serial number: ${stationSN}!`);
|
|
325
|
+
const station = this.getStation(stationSN);
|
|
326
|
+
return station.isEnergySavingDevice();
|
|
332
327
|
}
|
|
333
328
|
handleHouses(houses) {
|
|
334
329
|
this.log.debug("Got houses:", houses);
|
|
@@ -346,6 +341,7 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
346
341
|
else {
|
|
347
342
|
const station = new station_1.Station(this.api, hub);
|
|
348
343
|
station.on("connect", (station) => this.onStationConnect(station));
|
|
344
|
+
station.on("connection error", (station, error) => this.onStationConnectionError(station, error));
|
|
349
345
|
station.on("close", (station) => this.onStationClose(station));
|
|
350
346
|
station.on("raw device property changed", (deviceSN, params) => this.updateDeviceProperties(deviceSN, params));
|
|
351
347
|
station.on("livestream start", (station, channel, metadata, videostream, audiostream) => this.onStartStationLivestream(station, channel, metadata, videostream, audiostream));
|
|
@@ -371,6 +367,13 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
371
367
|
station.on("talkback stopped", (station, channel) => this.onStationTalkbackStop(station, channel));
|
|
372
368
|
station.on("talkback error", (station, channel, error) => this.onStationTalkbackError(station, channel, error));
|
|
373
369
|
station.on("alarm armed event", (station) => this.onStationAlarmArmedEvent(station));
|
|
370
|
+
station.on("alarm arm delay event", (station, armDelay) => this.onStationArmDelayEvent(station, armDelay));
|
|
371
|
+
station.on("secondary command result", (station, result) => this.onStationSecondaryCommandResult(station, result));
|
|
372
|
+
station.on("device shake alarm", (deviceSN, event) => this.onStationDeviceShakeAlarm(deviceSN, event));
|
|
373
|
+
station.on("device 911 alarm", (deviceSN, event) => this.onStationDevice911Alarm(deviceSN, event));
|
|
374
|
+
station.on("device jammed", (deviceSN) => this.onStationDeviceJammed(deviceSN));
|
|
375
|
+
station.on("device low battery", (deviceSN) => this.onStationDeviceLowBattery(deviceSN));
|
|
376
|
+
station.on("device wrong try-protect alarm", (deviceSN) => this.onStationDeviceWrongTryProtectAlarm(deviceSN));
|
|
374
377
|
this.addStation(station);
|
|
375
378
|
}
|
|
376
379
|
}
|
|
@@ -382,19 +385,24 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
382
385
|
}
|
|
383
386
|
onStationConnect(station) {
|
|
384
387
|
this.emit("station connect", station);
|
|
385
|
-
if (device_1.Device.isCamera(station.getDeviceType()) && !device_1.Device.isWiredDoorbell(station.getDeviceType())) {
|
|
388
|
+
if ((device_1.Device.isCamera(station.getDeviceType()) && !device_1.Device.isWiredDoorbell(station.getDeviceType()) || device_1.Device.isSmartSafe(station.getDeviceType()))) {
|
|
386
389
|
station.getCameraInfo().catch(error => {
|
|
387
390
|
this.log.error(`Error during station ${station.getSerial()} p2p data refreshing`, error);
|
|
388
391
|
});
|
|
389
392
|
if (this.refreshEufySecurityP2PTimeout[station.getSerial()] !== undefined)
|
|
390
393
|
clearTimeout(this.refreshEufySecurityP2PTimeout[station.getSerial()]);
|
|
391
|
-
|
|
392
|
-
station.
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
394
|
+
if (!station.isEnergySavingDevice()) {
|
|
395
|
+
this.refreshEufySecurityP2PTimeout[station.getSerial()] = setTimeout(() => {
|
|
396
|
+
station.getCameraInfo().catch(error => {
|
|
397
|
+
this.log.error(`Error during station ${station.getSerial()} p2p data refreshing`, error);
|
|
398
|
+
});
|
|
399
|
+
}, this.P2P_REFRESH_INTERVAL_MIN * 60 * 1000);
|
|
400
|
+
}
|
|
396
401
|
}
|
|
397
402
|
}
|
|
403
|
+
onStationConnectionError(station, error) {
|
|
404
|
+
this.emit("station connection error", station, error);
|
|
405
|
+
}
|
|
398
406
|
onStationClose(station) {
|
|
399
407
|
this.emit("station close", station);
|
|
400
408
|
for (const device_sn of this.cameraStationLivestreamTimeout.keys()) {
|
|
@@ -449,25 +457,41 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
449
457
|
else if (device_1.Device.isKeyPad(device.device_type)) {
|
|
450
458
|
new_device = device_1.Keypad.initialize(this.api, device);
|
|
451
459
|
}
|
|
460
|
+
else if (device_1.Device.isSmartSafe(device.device_type)) {
|
|
461
|
+
new_device = device_1.SmartSafe.initialize(this.api, device);
|
|
462
|
+
}
|
|
452
463
|
else {
|
|
453
464
|
new_device = device_1.UnknownDevice.initialize(this.api, device);
|
|
454
465
|
}
|
|
455
466
|
promises.push(new_device.then((device) => {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
467
|
+
try {
|
|
468
|
+
device.on("property changed", (device, name, value) => this.onDevicePropertyChanged(device, name, value));
|
|
469
|
+
device.on("raw property changed", (device, type, value) => this.onDeviceRawPropertyChanged(device, type, value));
|
|
470
|
+
device.on("crying detected", (device, state) => this.onDeviceCryingDetected(device, state));
|
|
471
|
+
device.on("sound detected", (device, state) => this.onDeviceSoundDetected(device, state));
|
|
472
|
+
device.on("pet detected", (device, state) => this.onDevicePetDetected(device, state));
|
|
473
|
+
device.on("motion detected", (device, state) => this.onDeviceMotionDetected(device, state));
|
|
474
|
+
device.on("person detected", (device, state, person) => this.onDevicePersonDetected(device, state, person));
|
|
475
|
+
device.on("rings", (device, state) => this.onDeviceRings(device, state));
|
|
476
|
+
device.on("locked", (device, state) => this.onDeviceLocked(device, state));
|
|
477
|
+
device.on("open", (device, state) => this.onDeviceOpen(device, state));
|
|
478
|
+
device.on("ready", (device) => this.onDeviceReady(device));
|
|
479
|
+
device.on("package delivered", (device, state) => this.onDevicePackageDelivered(device, state));
|
|
480
|
+
device.on("package stranded", (device, state) => this.onDevicePackageStranded(device, state));
|
|
481
|
+
device.on("package taken", (device, state) => this.onDevicePackageTaken(device, state));
|
|
482
|
+
device.on("someone loitering", (device, state) => this.onDeviceSomeoneLoitering(device, state));
|
|
483
|
+
device.on("radar motion detected", (device, state) => this.onDeviceRadarMotionDetected(device, state));
|
|
484
|
+
device.on("911 alarm", (device, state, detail) => this.onDevice911Alarm(device, state, detail));
|
|
485
|
+
device.on("shake alarm", (device, state, detail) => this.onDeviceShakeAlarm(device, state, detail));
|
|
486
|
+
device.on("wrong try-protect alarm", (device, state) => this.onDeviceWrongTryProtectAlarm(device, state));
|
|
487
|
+
device.on("long time not close", (device, state) => this.onDeviceLongTimeNotClose(device, state));
|
|
488
|
+
device.on("low battery", (device, state) => this.onDeviceLowBattery(device, state));
|
|
489
|
+
device.on("jammed", (device, state) => this.onDeviceJammed(device, state));
|
|
490
|
+
this.addDevice(device);
|
|
491
|
+
}
|
|
492
|
+
catch (error) {
|
|
493
|
+
this.log.error("Error", error);
|
|
494
|
+
}
|
|
471
495
|
return device;
|
|
472
496
|
}));
|
|
473
497
|
}
|
|
@@ -588,9 +612,9 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
588
612
|
async onAPIConnect() {
|
|
589
613
|
this.connected = true;
|
|
590
614
|
this.retries = 0;
|
|
591
|
-
this.emit("connect");
|
|
592
615
|
this.saveCloudToken();
|
|
593
616
|
await this.refreshCloudData();
|
|
617
|
+
this.emit("connect");
|
|
594
618
|
this.registerPushNotifications(this.persistentData.push_credentials, this.persistentData.push_persistentIds);
|
|
595
619
|
const loginData = this.api.getPersistentData();
|
|
596
620
|
if (loginData) {
|
|
@@ -1059,47 +1083,35 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1059
1083
|
case types_1.PropertyName.DeviceAutoCalibration:
|
|
1060
1084
|
await station.setAutoCalibration(device, value);
|
|
1061
1085
|
break;
|
|
1062
|
-
case types_1.PropertyName.
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
case types_1.PropertyName.
|
|
1066
|
-
|
|
1086
|
+
case types_1.PropertyName.DeviceAutoLock:
|
|
1087
|
+
case types_1.PropertyName.DeviceAutoLockSchedule:
|
|
1088
|
+
case types_1.PropertyName.DeviceAutoLockScheduleStartTime:
|
|
1089
|
+
case types_1.PropertyName.DeviceAutoLockScheduleEndTime:
|
|
1090
|
+
case types_1.PropertyName.DeviceAutoLockTimer:
|
|
1091
|
+
case types_1.PropertyName.DeviceOneTouchLocking:
|
|
1092
|
+
case types_1.PropertyName.DeviceSound:
|
|
1093
|
+
await station.setAdvancedLockParams(device, name, value);
|
|
1067
1094
|
break;
|
|
1068
|
-
case types_1.PropertyName.
|
|
1069
|
-
await station.setAdvancedLockParams(device, types_1.PropertyName.
|
|
1095
|
+
case types_1.PropertyName.DeviceNotification:
|
|
1096
|
+
await station.setAdvancedLockParams(device, types_1.PropertyName.DeviceNotification, value);
|
|
1070
1097
|
break;
|
|
1071
|
-
case types_1.PropertyName.
|
|
1072
|
-
await station.setAdvancedLockParams(device, types_1.PropertyName.
|
|
1098
|
+
case types_1.PropertyName.DeviceNotificationLocked:
|
|
1099
|
+
await station.setAdvancedLockParams(device, types_1.PropertyName.DeviceNotificationLocked, value);
|
|
1073
1100
|
break;
|
|
1074
|
-
case types_1.PropertyName.
|
|
1075
|
-
await station.setAdvancedLockParams(device, types_1.PropertyName.
|
|
1101
|
+
case types_1.PropertyName.DeviceNotificationUnlocked:
|
|
1102
|
+
await station.setAdvancedLockParams(device, types_1.PropertyName.DeviceNotificationUnlocked, value);
|
|
1076
1103
|
break;
|
|
1077
|
-
case types_1.PropertyName.
|
|
1078
|
-
await station.
|
|
1104
|
+
case types_1.PropertyName.DeviceScramblePasscode:
|
|
1105
|
+
await station.setScramblePasscode(device, value);
|
|
1079
1106
|
break;
|
|
1080
|
-
case types_1.PropertyName.
|
|
1081
|
-
await station.
|
|
1107
|
+
case types_1.PropertyName.DeviceWrongTryProtection:
|
|
1108
|
+
await station.setWrongTryProtection(device, value);
|
|
1082
1109
|
break;
|
|
1083
|
-
case types_1.PropertyName.
|
|
1084
|
-
await station.
|
|
1110
|
+
case types_1.PropertyName.DeviceWrongTryAttempts:
|
|
1111
|
+
await station.setWrongTryAttempts(device, value);
|
|
1085
1112
|
break;
|
|
1086
|
-
case types_1.PropertyName.
|
|
1087
|
-
await station.
|
|
1088
|
-
break;
|
|
1089
|
-
case types_1.PropertyName.DeviceLockSettingsScramblePasscode:
|
|
1090
|
-
await station.setAdvancedLockParams(device, types_1.PropertyName.DeviceLockSettingsScramblePasscode, value);
|
|
1091
|
-
break;
|
|
1092
|
-
case types_1.PropertyName.DeviceLockSettingsSound:
|
|
1093
|
-
await station.setAdvancedLockParams(device, types_1.PropertyName.DeviceLockSettingsSound, value);
|
|
1094
|
-
break;
|
|
1095
|
-
case types_1.PropertyName.DeviceLockSettingsWrongTryProtection:
|
|
1096
|
-
await station.setAdvancedLockParams(device, types_1.PropertyName.DeviceLockSettingsWrongTryProtection, value);
|
|
1097
|
-
break;
|
|
1098
|
-
case types_1.PropertyName.DeviceLockSettingsWrongTryAttempts:
|
|
1099
|
-
await station.setAdvancedLockParams(device, types_1.PropertyName.DeviceLockSettingsWrongTryAttempts, value);
|
|
1100
|
-
break;
|
|
1101
|
-
case types_1.PropertyName.DeviceLockSettingsWrongTryLockdownTime:
|
|
1102
|
-
await station.setAdvancedLockParams(device, types_1.PropertyName.DeviceLockSettingsWrongTryLockdownTime, value);
|
|
1113
|
+
case types_1.PropertyName.DeviceWrongTryLockdownTime:
|
|
1114
|
+
await station.setWrongTryLockdownTime(device, value);
|
|
1103
1115
|
break;
|
|
1104
1116
|
case types_1.PropertyName.DeviceLoiteringDetection:
|
|
1105
1117
|
await station.setLoiteringDetection(device, value);
|
|
@@ -1224,6 +1236,27 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1224
1236
|
case types_1.PropertyName.DeviceDeliveryGuardUncollectedPackageAlertTimeToCheck:
|
|
1225
1237
|
await station.setDeliveryGuardUncollectedPackageAlertTimeToCheck(device, value);
|
|
1226
1238
|
break;
|
|
1239
|
+
case types_1.PropertyName.DeviceLeftOpenAlarm:
|
|
1240
|
+
case types_1.PropertyName.DeviceLeftOpenAlarmDuration:
|
|
1241
|
+
case types_1.PropertyName.DeviceDualUnlock:
|
|
1242
|
+
case types_1.PropertyName.DevicePowerSave:
|
|
1243
|
+
case types_1.PropertyName.DeviceInteriorBrightness:
|
|
1244
|
+
case types_1.PropertyName.DeviceInteriorBrightnessDuration:
|
|
1245
|
+
case types_1.PropertyName.DeviceTamperAlarm:
|
|
1246
|
+
case types_1.PropertyName.DeviceRemoteUnlock:
|
|
1247
|
+
case types_1.PropertyName.DeviceRemoteUnlockMasterPIN:
|
|
1248
|
+
case types_1.PropertyName.DeviceAlarmVolume:
|
|
1249
|
+
case types_1.PropertyName.DevicePromptVolume:
|
|
1250
|
+
case types_1.PropertyName.DeviceNotificationUnlockByKey:
|
|
1251
|
+
case types_1.PropertyName.DeviceNotificationUnlockByPIN:
|
|
1252
|
+
case types_1.PropertyName.DeviceNotificationUnlockByFingerprint:
|
|
1253
|
+
case types_1.PropertyName.DeviceNotificationUnlockByApp:
|
|
1254
|
+
case types_1.PropertyName.DeviceNotificationDualUnlock:
|
|
1255
|
+
case types_1.PropertyName.DeviceNotificationDualLock:
|
|
1256
|
+
case types_1.PropertyName.DeviceNotificationWrongTryProtect:
|
|
1257
|
+
case types_1.PropertyName.DeviceNotificationJammed:
|
|
1258
|
+
await station.setSmartSafeParams(device, name, value);
|
|
1259
|
+
break;
|
|
1227
1260
|
default:
|
|
1228
1261
|
if (!Object.values(types_1.PropertyName).includes(name))
|
|
1229
1262
|
throw new error_1.ReadOnlyPropertyError(`Property ${name} is read only`);
|
|
@@ -1333,7 +1366,8 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1333
1366
|
this.emit("station command result", station, result);
|
|
1334
1367
|
if (result.return_code === 0) {
|
|
1335
1368
|
this.getStationDevice(station.getSerial(), result.channel).then((device) => {
|
|
1336
|
-
|
|
1369
|
+
//TODO: Finish SmartSafe implementation - check better the if below
|
|
1370
|
+
if (result.property !== undefined && (device.isSmartSafe() && result.command_type !== types_2.CommandType.CMD_SMARTSAFE_SETTINGS) && !device.isLock()) {
|
|
1337
1371
|
if (device.hasProperty(result.property.name))
|
|
1338
1372
|
device.updateProperty(result.property.name, result.property.value);
|
|
1339
1373
|
else if (station.hasProperty(result.property.name)) {
|
|
@@ -1350,6 +1384,31 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1350
1384
|
this.log.error(`Station command result error (station: ${station.getSerial()})`, error);
|
|
1351
1385
|
}
|
|
1352
1386
|
});
|
|
1387
|
+
if (station.isIntegratedDevice() && result.command_type === types_2.CommandType.CMD_SET_ARMING && station.isConnected() && station.getDeviceType() !== types_1.DeviceType.DOORBELL) {
|
|
1388
|
+
station.getCameraInfo();
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
onStationSecondaryCommandResult(station, result) {
|
|
1393
|
+
if (result.return_code === 0) {
|
|
1394
|
+
this.getStationDevice(station.getSerial(), result.channel).then((device) => {
|
|
1395
|
+
if (result.property !== undefined) {
|
|
1396
|
+
if (device.hasProperty(result.property.name))
|
|
1397
|
+
device.updateProperty(result.property.name, result.property.value);
|
|
1398
|
+
else if (station.hasProperty(result.property.name)) {
|
|
1399
|
+
station.updateProperty(result.property.name, result.property.value);
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
}).catch((error) => {
|
|
1403
|
+
if (error instanceof error_1.DeviceNotFoundError) {
|
|
1404
|
+
if (result.property !== undefined) {
|
|
1405
|
+
station.updateProperty(result.property.name, result.property.value);
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
else {
|
|
1409
|
+
this.log.error(`Station secondary command result error (station: ${station.getSerial()})`, error);
|
|
1410
|
+
}
|
|
1411
|
+
});
|
|
1353
1412
|
}
|
|
1354
1413
|
}
|
|
1355
1414
|
onStationRtspUrl(station, channel, value) {
|
|
@@ -1378,6 +1437,9 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1378
1437
|
onStationAlarmDelayEvent(station, alarmDelayEvent, alarmDelay) {
|
|
1379
1438
|
this.emit("station alarm delay event", station, alarmDelayEvent, alarmDelay);
|
|
1380
1439
|
}
|
|
1440
|
+
onStationArmDelayEvent(station, armDelay) {
|
|
1441
|
+
this.emit("station alarm arm delay event", station, armDelay);
|
|
1442
|
+
}
|
|
1381
1443
|
onStationAlarmArmedEvent(station) {
|
|
1382
1444
|
this.emit("station alarm armed", station);
|
|
1383
1445
|
}
|
|
@@ -1422,6 +1484,39 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1422
1484
|
onDeviceOpen(device, state) {
|
|
1423
1485
|
this.emit("device open", device, state);
|
|
1424
1486
|
}
|
|
1487
|
+
onDevicePackageDelivered(device, state) {
|
|
1488
|
+
this.emit("device package delivered", device, state);
|
|
1489
|
+
}
|
|
1490
|
+
onDevicePackageStranded(device, state) {
|
|
1491
|
+
this.emit("device package stranded", device, state);
|
|
1492
|
+
}
|
|
1493
|
+
onDevicePackageTaken(device, state) {
|
|
1494
|
+
this.emit("device package taken", device, state);
|
|
1495
|
+
}
|
|
1496
|
+
onDeviceSomeoneLoitering(device, state) {
|
|
1497
|
+
this.emit("device someone loitering", device, state);
|
|
1498
|
+
}
|
|
1499
|
+
onDeviceRadarMotionDetected(device, state) {
|
|
1500
|
+
this.emit("device radar motion detected", device, state);
|
|
1501
|
+
}
|
|
1502
|
+
onDevice911Alarm(device, state, detail) {
|
|
1503
|
+
this.emit("device 911 alarm", device, state, detail);
|
|
1504
|
+
}
|
|
1505
|
+
onDeviceShakeAlarm(device, state, detail) {
|
|
1506
|
+
this.emit("device shake alarm", device, state, detail);
|
|
1507
|
+
}
|
|
1508
|
+
onDeviceWrongTryProtectAlarm(device, state) {
|
|
1509
|
+
this.emit("device wrong try-protect alarm", device, state);
|
|
1510
|
+
}
|
|
1511
|
+
onDeviceLongTimeNotClose(device, state) {
|
|
1512
|
+
this.emit("device long time not close", device, state);
|
|
1513
|
+
}
|
|
1514
|
+
onDeviceLowBattery(device, state) {
|
|
1515
|
+
this.emit("device low battery", device, state);
|
|
1516
|
+
}
|
|
1517
|
+
onDeviceJammed(device, state) {
|
|
1518
|
+
this.emit("device jammed", device, state);
|
|
1519
|
+
}
|
|
1425
1520
|
onDeviceReady(device) {
|
|
1426
1521
|
try {
|
|
1427
1522
|
if (device.getPropertyValue(types_1.PropertyName.DeviceRTSPStream) !== undefined && device.getPropertyValue(types_1.PropertyName.DeviceRTSPStream) === true) {
|
|
@@ -1547,6 +1642,46 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1547
1642
|
this.log.warn(`The station talkback for the device ${deviceSN} cannot be stopped, because it isn't live streaming!`);
|
|
1548
1643
|
}
|
|
1549
1644
|
}
|
|
1645
|
+
onStationDeviceShakeAlarm(deviceSN, event) {
|
|
1646
|
+
this.getDevice(deviceSN).then((device) => {
|
|
1647
|
+
if (device.isSmartSafe())
|
|
1648
|
+
device.shakeEvent(event, this.config.eventDurationSeconds);
|
|
1649
|
+
}).catch((error) => {
|
|
1650
|
+
this.log.error(`onStationShakeAlarm device ${deviceSN} error`, error);
|
|
1651
|
+
});
|
|
1652
|
+
}
|
|
1653
|
+
onStationDevice911Alarm(deviceSN, event) {
|
|
1654
|
+
this.getDevice(deviceSN).then((device) => {
|
|
1655
|
+
if (device.isSmartSafe())
|
|
1656
|
+
device.alarm911Event(event, this.config.eventDurationSeconds);
|
|
1657
|
+
}).catch((error) => {
|
|
1658
|
+
this.log.error(`onStation911Alarm device ${deviceSN} error`, error);
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
onStationDeviceJammed(deviceSN) {
|
|
1662
|
+
this.getDevice(deviceSN).then((device) => {
|
|
1663
|
+
if (device.isSmartSafe())
|
|
1664
|
+
device.jammedEvent(this.config.eventDurationSeconds);
|
|
1665
|
+
}).catch((error) => {
|
|
1666
|
+
this.log.error(`onStationDeviceJammed device ${deviceSN} error`, error);
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
onStationDeviceLowBattery(deviceSN) {
|
|
1670
|
+
this.getDevice(deviceSN).then((device) => {
|
|
1671
|
+
if (device.isSmartSafe())
|
|
1672
|
+
device.lowBatteryEvent(this.config.eventDurationSeconds);
|
|
1673
|
+
}).catch((error) => {
|
|
1674
|
+
this.log.error(`onStationDeviceLowBattery device ${deviceSN} error`, error);
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
onStationDeviceWrongTryProtectAlarm(deviceSN) {
|
|
1678
|
+
this.getDevice(deviceSN).then((device) => {
|
|
1679
|
+
if (device.isSmartSafe())
|
|
1680
|
+
device.wrongTryProtectAlarmEvent(this.config.eventDurationSeconds);
|
|
1681
|
+
}).catch((error) => {
|
|
1682
|
+
this.log.error(`onStationDeviceWrongTryProtectAlarm device ${deviceSN} error`, error);
|
|
1683
|
+
});
|
|
1684
|
+
}
|
|
1550
1685
|
}
|
|
1551
1686
|
exports.EufySecurity = EufySecurity;
|
|
1552
1687
|
//# sourceMappingURL=eufysecurity.js.map
|