eufy-security-client 3.1.0 → 3.1.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 +12 -0
- package/build/eufysecurity.d.ts +1 -1
- package/build/eufysecurity.js +29 -34
- package/build/eufysecurity.js.map +1 -1
- package/build/http/device.js +16 -0
- package/build/http/device.js.map +1 -1
- package/build/http/station.d.ts +2 -2
- package/build/http/station.js +102 -14
- package/build/http/station.js.map +1 -1
- package/build/http/types.d.ts +6 -0
- package/build/http/types.js +40 -15
- package/build/http/types.js.map +1 -1
- package/build/http/utils.d.ts +3 -1
- package/build/http/utils.js +20 -1
- package/build/http/utils.js.map +1 -1
- package/build/p2p/session.js +6 -12
- package/build/p2p/session.js.map +1 -1
- package/build/p2p/utils.d.ts +1 -0
- package/build/p2p/utils.js +17 -5
- package/build/p2p/utils.js.map +1 -1
- package/build/push/service.js +1 -1
- package/build/push/service.js.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -80,6 +80,18 @@ Please use GitHub issues for this.
|
|
|
80
80
|
|
|
81
81
|
## Changelog
|
|
82
82
|
|
|
83
|
+
### 3.1.1 (2024-09-28)
|
|
84
|
+
|
|
85
|
+
* (bropat) Added RTSP support for Indoor Cam S350 (T8416)
|
|
86
|
+
* (bropat) Fixed draining issues for some battery powered devices (instead of #544)
|
|
87
|
+
* (bropat) Fixed standalone support for Indoor Cam S350 (T8416; #550)
|
|
88
|
+
* (bropat) Fixed issue with encryption type level 2
|
|
89
|
+
* (bropat) Fixed issue #502 (untested)
|
|
90
|
+
* (bropat) Fixed issue #539
|
|
91
|
+
* (bropat) Fixed issue #547
|
|
92
|
+
* (PhilippEngler) FIX: hasCommand for DevicePresetPosition, DeviceSavePresetPosition and DeviceDeletePresetPosition (#551)
|
|
93
|
+
* (PhilippEngler) added preset commands T8170 (#552)
|
|
94
|
+
|
|
83
95
|
### 3.1.0 (2024-08-27)
|
|
84
96
|
|
|
85
97
|
* (bropat) **Breaking Change** Requires node version >= 20.0.0
|
package/build/eufysecurity.d.ts
CHANGED
|
@@ -44,7 +44,6 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
|
|
|
44
44
|
private addStation;
|
|
45
45
|
private removeStation;
|
|
46
46
|
private updateStation;
|
|
47
|
-
private getStorageInfo;
|
|
48
47
|
private addDevice;
|
|
49
48
|
private removeDevice;
|
|
50
49
|
private updateDevice;
|
|
@@ -60,6 +59,7 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
|
|
|
60
59
|
isStationEnergySavingDevice(stationSN: string): Promise<boolean>;
|
|
61
60
|
private handleHouses;
|
|
62
61
|
private handleHubs;
|
|
62
|
+
private refreshP2PData;
|
|
63
63
|
private onStationConnect;
|
|
64
64
|
private onStationConnectionError;
|
|
65
65
|
private onStationClose;
|
package/build/eufysecurity.js
CHANGED
|
@@ -316,7 +316,6 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
316
316
|
const serial = station.getSerial();
|
|
317
317
|
if (serial && !Object.keys(this.stations).includes(serial)) {
|
|
318
318
|
this.stations[serial] = station;
|
|
319
|
-
this.getStorageInfo(serial);
|
|
320
319
|
this.emit("station added", station);
|
|
321
320
|
}
|
|
322
321
|
else {
|
|
@@ -346,24 +345,11 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
346
345
|
logging_1.rootMainLogger.debug(`Updating station cloud data - initiate station connection to get local data over p2p`, { stationSN: hub.station_sn });
|
|
347
346
|
this.stations[hub.station_sn].connect();
|
|
348
347
|
}
|
|
349
|
-
this.getStorageInfo(hub.station_sn);
|
|
350
348
|
}
|
|
351
349
|
else {
|
|
352
350
|
logging_1.rootMainLogger.debug(`Station with this serial ${hub.station_sn} doesn't exists and couldn't be updated!`);
|
|
353
351
|
}
|
|
354
352
|
}
|
|
355
|
-
async getStorageInfo(stationSerial) {
|
|
356
|
-
try {
|
|
357
|
-
const station = await this.getStation(stationSerial);
|
|
358
|
-
if (station.isStation() || (station.hasProperty(types_1.PropertyName.StationSdStatus) && station.getPropertyValue(types_1.PropertyName.StationSdStatus) !== undefined && station.getPropertyValue(types_1.PropertyName.StationSdStatus) !== types_2.TFCardStatus.REMOVE)) {
|
|
359
|
-
station.getStorageInfoEx();
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
catch (err) {
|
|
363
|
-
const error = (0, error_1.ensureError)(err);
|
|
364
|
-
logging_1.rootMainLogger.error("getStorageInfo Error", { error: (0, utils_1.getError)(error), stationSN: stationSerial });
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
353
|
addDevice(device) {
|
|
368
354
|
const serial = device.getSerial();
|
|
369
355
|
if (serial && !Object.keys(this.devices).includes(serial)) {
|
|
@@ -564,30 +550,28 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
564
550
|
}
|
|
565
551
|
}
|
|
566
552
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
if (station_1.Station.isStation(station.getDeviceType()) || (device_1.Device.isCamera(station.getDeviceType()) && !device_1.Device.isWiredDoorbell(station.getDeviceType()) || device_1.Device.isSmartSafe(station.getDeviceType()))) {
|
|
553
|
+
refreshP2PData(station) {
|
|
554
|
+
if (station.isStation() || (device_1.Device.isCamera(station.getDeviceType()) && !device_1.Device.isWiredDoorbell(station.getDeviceType()) || device_1.Device.isSmartSafe(station.getDeviceType()))) {
|
|
570
555
|
station.getCameraInfo();
|
|
571
|
-
if (this.refreshEufySecurityP2PTimeout[station.getSerial()] !== undefined) {
|
|
572
|
-
clearTimeout(this.refreshEufySecurityP2PTimeout[station.getSerial()]);
|
|
573
|
-
delete this.refreshEufySecurityP2PTimeout[station.getSerial()];
|
|
574
|
-
}
|
|
575
|
-
this.refreshEufySecurityP2PTimeout[station.getSerial()] = setTimeout(() => {
|
|
576
|
-
station.getCameraInfo();
|
|
577
|
-
}, this.P2P_REFRESH_INTERVAL_MIN * 60 * 1000);
|
|
578
556
|
}
|
|
579
|
-
|
|
557
|
+
if (device_1.Device.isLock(station.getDeviceType())) {
|
|
580
558
|
station.getLockParameters();
|
|
581
559
|
station.getLockStatus();
|
|
582
|
-
if (this.refreshEufySecurityP2PTimeout[station.getSerial()] !== undefined) {
|
|
583
|
-
clearTimeout(this.refreshEufySecurityP2PTimeout[station.getSerial()]);
|
|
584
|
-
delete this.refreshEufySecurityP2PTimeout[station.getSerial()];
|
|
585
|
-
}
|
|
586
|
-
this.refreshEufySecurityP2PTimeout[station.getSerial()] = setTimeout(() => {
|
|
587
|
-
station.getLockParameters();
|
|
588
|
-
station.getLockStatus();
|
|
589
|
-
}, this.P2P_REFRESH_INTERVAL_MIN * 60 * 1000);
|
|
590
560
|
}
|
|
561
|
+
if (station.isStation() || (station.hasProperty(types_1.PropertyName.StationSdStatus) && station.getPropertyValue(types_1.PropertyName.StationSdStatus) !== types_2.TFCardStatus.REMOVE)) {
|
|
562
|
+
station.getStorageInfoEx();
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
onStationConnect(station) {
|
|
566
|
+
this.emit("station connect", station);
|
|
567
|
+
this.refreshP2PData(station);
|
|
568
|
+
if (this.refreshEufySecurityP2PTimeout[station.getSerial()] !== undefined) {
|
|
569
|
+
clearTimeout(this.refreshEufySecurityP2PTimeout[station.getSerial()]);
|
|
570
|
+
delete this.refreshEufySecurityP2PTimeout[station.getSerial()];
|
|
571
|
+
}
|
|
572
|
+
this.refreshEufySecurityP2PTimeout[station.getSerial()] = setTimeout(() => {
|
|
573
|
+
this.refreshP2PData(station);
|
|
574
|
+
}, this.P2P_REFRESH_INTERVAL_MIN * 60 * 1000);
|
|
591
575
|
}
|
|
592
576
|
onStationConnectionError(station, error) {
|
|
593
577
|
this.emit("station connection error", station, error);
|
|
@@ -1561,12 +1545,20 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1561
1545
|
else if (device.isSoloCameras()) {
|
|
1562
1546
|
station.setMotionDetectionTypeHB3(device, types_1.SoloCameraDetectionTypes.HUMAN_DETECTION, value);
|
|
1563
1547
|
}
|
|
1548
|
+
else if (device.isIndoorPanAndTiltCameraS350()) {
|
|
1549
|
+
station.setMotionDetectionTypeHB3(device, types_1.IndoorS350DetectionTypes.HUMAN_DETECTION, value);
|
|
1550
|
+
}
|
|
1564
1551
|
else {
|
|
1565
1552
|
station.setMotionDetectionTypeHB3(device, types_1.HB3DetectionTypes.HUMAN_DETECTION, value);
|
|
1566
1553
|
}
|
|
1567
1554
|
break;
|
|
1568
1555
|
case types_1.PropertyName.DeviceMotionDetectionTypePet:
|
|
1569
|
-
|
|
1556
|
+
if (device.isIndoorPanAndTiltCameraS350()) {
|
|
1557
|
+
station.setMotionDetectionTypeHB3(device, types_1.IndoorS350DetectionTypes.PET_DETECTION, value);
|
|
1558
|
+
}
|
|
1559
|
+
else {
|
|
1560
|
+
station.setMotionDetectionTypeHB3(device, types_1.HB3DetectionTypes.PET_DETECTION, value);
|
|
1561
|
+
}
|
|
1570
1562
|
break;
|
|
1571
1563
|
case types_1.PropertyName.DeviceMotionDetectionTypeVehicle:
|
|
1572
1564
|
if (device.isOutdoorPanAndTiltCamera()) {
|
|
@@ -1586,6 +1578,9 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
1586
1578
|
else if (device.isSoloCameras()) {
|
|
1587
1579
|
station.setMotionDetectionTypeHB3(device, types_1.SoloCameraDetectionTypes.ALL_OTHER_MOTION, value);
|
|
1588
1580
|
}
|
|
1581
|
+
else if (device.isIndoorPanAndTiltCameraS350()) {
|
|
1582
|
+
station.setMotionDetectionTypeHB3(device, types_1.IndoorS350DetectionTypes.ALL_OTHER_MOTION, value);
|
|
1583
|
+
}
|
|
1589
1584
|
else {
|
|
1590
1585
|
station.setMotionDetectionTypeHB3(device, types_1.HB3DetectionTypes.ALL_OTHER_MOTION, value);
|
|
1591
1586
|
}
|