@homebridge-eufy-security/eufy-security-client 3.7.2-dev.6 → 3.8.0-dev.8
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/eufysecurity.d.ts +2 -0
- package/build/eufysecurity.js +27 -0
- package/build/eufysecurity.js.map +1 -1
- package/build/http/api.d.ts +2 -0
- package/build/http/api.js +39 -6
- package/build/http/api.js.map +1 -1
- package/build/http/device.d.ts +16 -1
- package/build/http/device.js +79 -13
- package/build/http/device.js.map +1 -1
- package/build/http/interfaces.d.ts +1 -0
- package/build/http/models.d.ts +1 -0
- package/build/http/station.d.ts +9 -1
- package/build/http/station.js +39 -12
- package/build/http/station.js.map +1 -1
- package/build/http/types.d.ts +6 -0
- package/build/http/types.js +386 -6
- package/build/http/types.js.map +1 -1
- package/build/p2p/adts.d.ts +12 -0
- package/build/p2p/adts.js +185 -0
- package/build/p2p/adts.js.map +1 -0
- package/build/p2p/interfaces.d.ts +10 -0
- package/build/p2p/session.d.ts +3 -1
- package/build/p2p/session.js +121 -29
- package/build/p2p/session.js.map +1 -1
- package/build/p2p/types.d.ts +1 -0
- package/build/p2p/types.js +1 -0
- package/build/p2p/types.js.map +1 -1
- package/build/p2p/utils.d.ts +10 -0
- package/build/p2p/utils.js +64 -2
- package/build/p2p/utils.js.map +1 -1
- package/build/push/service.js +1 -1
- package/build/push/service.js.map +1 -1
- package/coverage/clover.xml +10961 -10772
- package/coverage/coverage-final.json +27 -26
- package/coverage/lcov-report/index.html +59 -59
- package/coverage/lcov.info +18960 -18612
- package/package.json +5 -1
- package/scripts/cut_release.sh +2 -0
- package/scripts/generate_changelog.sh +93 -0
|
@@ -204,6 +204,7 @@ export interface StationEvents {
|
|
|
204
204
|
"sensor status": (station: Station, channel: number, status: number) => void;
|
|
205
205
|
"garage door status": (station: Station, channel: number, doorId: number, status: number) => void;
|
|
206
206
|
"storage info hb3": (station: Station, channel: number, storageInfo: StorageInfoBodyHB3) => void;
|
|
207
|
+
"hub notify update": (station: Station) => void;
|
|
207
208
|
}
|
|
208
209
|
export interface DeviceEvents {
|
|
209
210
|
"property changed": (device: Device, name: string, value: PropertyValue, ready: boolean) => void;
|
package/build/http/models.d.ts
CHANGED
package/build/http/station.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { HTTPApi } from "./api";
|
|
|
3
3
|
import { AlarmTone, NotificationSwitchMode, DeviceType, FloodlightMotionTriggeredDistance, GuardMode, NotificationType, PowerSource, PropertyName, TimeFormat, CommandName, VideoTypeStoreToNAS, HB3DetectionTypes, WalllightNotificationType, DailyLightingType, MotionActivationMode, LightingActiveMode, SourceType, T8170DetectionTypes, IndoorS350NotificationTypes, SoloCameraDetectionTypes, MotionDetectionRangeType, ViewModeType, FloodlightT8425NotificationTypes, PresetPositionType, IndoorS350DetectionTypes, EufyCamC35DetectionTypes } from "./types";
|
|
4
4
|
import { SnoozeDetail, StationListResponse } from "./models";
|
|
5
5
|
import { IndexedProperty, PropertyMetadataAny, PropertyValue, PropertyValues, RawValues, StationEvents, Schedule } from "./interfaces";
|
|
6
|
-
import { CrossTrackingGroupEntry, DynamicLighting, MotionZone, RGBColor } from "../p2p/interfaces";
|
|
6
|
+
import { CrossTrackingGroupEntry, DynamicLighting, MotionZone, RGBColor, StreamTimeoutOptions } from "../p2p/interfaces";
|
|
7
7
|
import { CalibrateGarageType, FilterDetectType, FilterEventType, FilterStorageType, P2PConnectionType, PanTiltDirection, VideoCodec, WatermarkSetting1, WatermarkSetting2, WatermarkSetting3, WatermarkSetting4, WatermarkSetting5 } from "../p2p/types";
|
|
8
8
|
import { Device } from "./device";
|
|
9
9
|
import { PushMessage } from "../push/models";
|
|
@@ -51,11 +51,17 @@ export declare class Station extends TypedEmitter<StationEvents> {
|
|
|
51
51
|
static isStationHomeBase2OrOlder(type: number): boolean;
|
|
52
52
|
static isStationHomeBase3(type: number): boolean;
|
|
53
53
|
static isStationHomeBaseMini(type: number): boolean;
|
|
54
|
+
static isStationNVR(type: number): boolean;
|
|
54
55
|
static isStationHomeBase3BySn(sn: string): boolean;
|
|
55
56
|
static isStationHomeBaseMiniBySn(sn: string): boolean;
|
|
57
|
+
static isStationMiniBaseChime(type: number): boolean;
|
|
58
|
+
static isStationMiniBaseChimeBySn(sn: string): boolean;
|
|
59
|
+
static isStationNVRBySn(sn: string): boolean;
|
|
56
60
|
isStationHomeBase2OrOlder(): boolean;
|
|
57
61
|
isStationHomeBase3(): boolean;
|
|
58
62
|
isStationHomeBaseMini(): boolean;
|
|
63
|
+
isStationMiniBaseChime(): boolean;
|
|
64
|
+
isStationNVR(): boolean;
|
|
59
65
|
/**
|
|
60
66
|
* Checks if the station is a HomeBase 3 or HomeBase mini for determining if SoloDevices are connected to a supported HomeBase.
|
|
61
67
|
* @returns Returns true, if this is a HomeBase 3 or a HomeBase mini, otherwise false.
|
|
@@ -182,6 +188,7 @@ export declare class Station extends TypedEmitter<StationEvents> {
|
|
|
182
188
|
startLivestream(device: Device, videoCodec?: VideoCodec): void;
|
|
183
189
|
stopLivestream(device: Device): void;
|
|
184
190
|
isLiveStreaming(device: Device): boolean;
|
|
191
|
+
setStreamTimeouts(options: StreamTimeoutOptions): void;
|
|
185
192
|
isDownloading(device: Device): boolean;
|
|
186
193
|
quickResponse(device: Device, voice_id: number): void;
|
|
187
194
|
setChirpVolume(device: Device, value: number): void;
|
|
@@ -375,6 +382,7 @@ export declare class Station extends TypedEmitter<StationEvents> {
|
|
|
375
382
|
getLockParameters(): void;
|
|
376
383
|
getLockStatus(): void;
|
|
377
384
|
private onSequenceError;
|
|
385
|
+
private onHubNotifyUpdate;
|
|
378
386
|
updateUsername(device: Device, username: string, passwordId: string): void;
|
|
379
387
|
setOpenMethod(device: Device, value: number): void;
|
|
380
388
|
setMotionActivatedPrompt(device: Device, value: boolean): void;
|
package/build/http/station.js
CHANGED
|
@@ -80,6 +80,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
80
80
|
this.p2pSession.on("garage door status", (channel, doorId, status) => this.onGarageDoorStatus(channel, doorId, status));
|
|
81
81
|
this.p2pSession.on("storage info hb3", (channel, storageInfo) => this.onStorageInfoHB3(channel, storageInfo));
|
|
82
82
|
this.p2pSession.on("sequence error", (channel, command, sequence, serialnumber) => this.onSequenceError(channel, command, sequence, serialnumber));
|
|
83
|
+
this.p2pSession.on("hub notify update", () => this.onHubNotifyUpdate());
|
|
83
84
|
}
|
|
84
85
|
initializeState() {
|
|
85
86
|
this.update(this.rawStation);
|
|
@@ -99,7 +100,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
99
100
|
!device_1.Device.isLockWifiT8510P(stationData.device_type, stationData.station_sn) &&
|
|
100
101
|
!device_1.Device.isLockWifiT8520P(stationData.device_type, stationData.station_sn) &&
|
|
101
102
|
!device_1.Device.isLockWifiT85L0(stationData.device_type) &&
|
|
102
|
-
!device_1.Device.isLockWifiT85V0(stationData.device_type
|
|
103
|
+
!device_1.Device.isLockWifiT85V0(stationData.device_type)) {
|
|
103
104
|
publicKey = await api.getPublicKey(stationData.station_sn, types_1.PublicKeyType.LOCK);
|
|
104
105
|
}
|
|
105
106
|
return new Station(api, stationData, ipAddress, listeningPort, publicKey, enableEmbeddedPKCS1Support);
|
|
@@ -406,8 +407,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
406
407
|
if (property.name === types_1.PropertyName.Model && device_1.Device.isLockWifiT8510P(this.getDeviceType(), this.getSerial())) {
|
|
407
408
|
return "T8510P";
|
|
408
409
|
}
|
|
409
|
-
else if (property.name === types_1.PropertyName.Model &&
|
|
410
|
-
device_1.Device.isLockWifiT85V0(this.getDeviceType(), this.getSerial())) {
|
|
410
|
+
else if (property.name === types_1.PropertyName.Model && device_1.Device.isLockWifiT85V0(this.getDeviceType())) {
|
|
411
411
|
return "T85V0";
|
|
412
412
|
}
|
|
413
413
|
else if (property.type === "number") {
|
|
@@ -561,7 +561,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
561
561
|
return (type === types_1.DeviceType.STATION ||
|
|
562
562
|
type === types_1.DeviceType.HB3 ||
|
|
563
563
|
type === types_1.DeviceType.MINIBASE_CHIME ||
|
|
564
|
-
type === types_1.DeviceType.HOMEBASE_MINI
|
|
564
|
+
type === types_1.DeviceType.HOMEBASE_MINI ||
|
|
565
|
+
type === types_1.DeviceType.NVR_S4_MAX);
|
|
565
566
|
}
|
|
566
567
|
isStation() {
|
|
567
568
|
return Station.isStation(this.rawStation.device_type);
|
|
@@ -575,12 +576,24 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
575
576
|
static isStationHomeBaseMini(type) {
|
|
576
577
|
return type === types_1.DeviceType.HOMEBASE_MINI;
|
|
577
578
|
}
|
|
579
|
+
static isStationNVR(type) {
|
|
580
|
+
return type === types_1.DeviceType.NVR_S4_MAX;
|
|
581
|
+
}
|
|
578
582
|
static isStationHomeBase3BySn(sn) {
|
|
579
583
|
return sn.startsWith("T8030");
|
|
580
584
|
}
|
|
581
585
|
static isStationHomeBaseMiniBySn(sn) {
|
|
582
586
|
return sn.startsWith("T8025");
|
|
583
587
|
}
|
|
588
|
+
static isStationMiniBaseChime(type) {
|
|
589
|
+
return type === types_1.DeviceType.MINIBASE_CHIME;
|
|
590
|
+
}
|
|
591
|
+
static isStationMiniBaseChimeBySn(sn) {
|
|
592
|
+
return sn.startsWith("T8023");
|
|
593
|
+
}
|
|
594
|
+
static isStationNVRBySn(sn) {
|
|
595
|
+
return sn.startsWith("T8N00");
|
|
596
|
+
}
|
|
584
597
|
isStationHomeBase2OrOlder() {
|
|
585
598
|
return Station.isStationHomeBase2OrOlder(this.rawStation.device_type);
|
|
586
599
|
}
|
|
@@ -590,6 +603,12 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
590
603
|
isStationHomeBaseMini() {
|
|
591
604
|
return Station.isStationHomeBaseMini(this.rawStation.device_type);
|
|
592
605
|
}
|
|
606
|
+
isStationMiniBaseChime() {
|
|
607
|
+
return Station.isStationMiniBaseChime(this.rawStation.device_type);
|
|
608
|
+
}
|
|
609
|
+
isStationNVR() {
|
|
610
|
+
return Station.isStationNVR(this.rawStation.device_type);
|
|
611
|
+
}
|
|
593
612
|
/**
|
|
594
613
|
* Checks if the station is a HomeBase 3 or HomeBase mini for determining if SoloDevices are connected to a supported HomeBase.
|
|
595
614
|
* @returns Returns true, if this is a HomeBase 3 or a HomeBase mini, otherwise false.
|
|
@@ -6592,7 +6611,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6592
6611
|
command: commandData,
|
|
6593
6612
|
});
|
|
6594
6613
|
}
|
|
6595
|
-
else if (device.isOutdoorPanAndTiltCamera()
|
|
6614
|
+
else if (device.isOutdoorPanAndTiltCamera() ||
|
|
6615
|
+
device.isFloodLightT8425() ||
|
|
6616
|
+
(device.isBatteryDoorbellDualE340() && !this.isStationMiniBaseChime()) ||
|
|
6617
|
+
((device.isIndoorPTCameraE30() || device.isIndoorCameraBase()) && this.isDeviceControlledByHomeBase())) {
|
|
6596
6618
|
logging_1.rootHTTPLogger.debug(`Station start livestream - sending command using CMD_DOORBELL_SET_PAYLOAD (1)`, {
|
|
6597
6619
|
stationSN: this.getSerial(),
|
|
6598
6620
|
deviceSN: device.getSerial(),
|
|
@@ -6617,9 +6639,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6617
6639
|
});
|
|
6618
6640
|
}
|
|
6619
6641
|
else if (device.isSoloCameras() ||
|
|
6620
|
-
device.
|
|
6621
|
-
device.
|
|
6622
|
-
device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8424 ||
|
|
6642
|
+
device.isFloodLightT8423() ||
|
|
6643
|
+
device.isFloodLightT8424() ||
|
|
6623
6644
|
device.isWiredDoorbellT8200X() ||
|
|
6624
6645
|
device.isWallLightCam() ||
|
|
6625
6646
|
device.isGarageCamera()) {
|
|
@@ -6644,8 +6665,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6644
6665
|
command: commandData,
|
|
6645
6666
|
});
|
|
6646
6667
|
}
|
|
6647
|
-
else if ((
|
|
6648
|
-
|
|
6668
|
+
else if ((device.isIndoorPanAndTiltCameraS350() || device.isIndoorCamC24()) &&
|
|
6669
|
+
this.isDeviceControlledByHomeBase()) {
|
|
6649
6670
|
logging_1.rootHTTPLogger.debug(`Station start livestream - sending command using CMD_SET_PAYLOAD`, {
|
|
6650
6671
|
stationSN: this.getSerial(),
|
|
6651
6672
|
deviceSN: device.getSerial(),
|
|
@@ -6847,6 +6868,9 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
6847
6868
|
return false;
|
|
6848
6869
|
return this.p2pSession.isLiveStreaming(device.getChannel());
|
|
6849
6870
|
}
|
|
6871
|
+
setStreamTimeouts(options) {
|
|
6872
|
+
this.p2pSession.setStreamTimeouts(options);
|
|
6873
|
+
}
|
|
6850
6874
|
isDownloading(device) {
|
|
6851
6875
|
if (device.getStationSerial() !== this.getSerial())
|
|
6852
6876
|
return false;
|
|
@@ -15474,7 +15498,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
15474
15498
|
device_1.Device.isLockWifiT8502(this.getDeviceType()) ||
|
|
15475
15499
|
device_1.Device.isLockWifiT8510P(this.getDeviceType(), this.getSerial()) ||
|
|
15476
15500
|
device_1.Device.isLockWifiT8520P(this.getDeviceType(), this.getSerial()) ||
|
|
15477
|
-
device_1.Device.isLockWifiT85V0(this.getDeviceType()
|
|
15501
|
+
device_1.Device.isLockWifiT85V0(this.getDeviceType()) ||
|
|
15478
15502
|
device_1.Device.isLockWifiT85L0(this.getDeviceType())) {
|
|
15479
15503
|
logging_1.rootHTTPLogger.debug(`Station smart lock send get lock parameters command`, { stationSN: this.getSerial() });
|
|
15480
15504
|
const command = (0, utils_2.getSmartLockP2PCommand)(this.rawStation.station_sn, this.rawStation.member.admin_user_id, types_2.SmartLockCommand.GET_LOCK_PARAM, 0, this.p2pSession.incLockSequenceNumber(), device_1.Lock.encodeCmdSmartLockGetParams(this.rawStation.member.admin_user_id));
|
|
@@ -15492,7 +15516,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
15492
15516
|
device_1.Device.isLockWifiT8502(this.getDeviceType()) ||
|
|
15493
15517
|
device_1.Device.isLockWifiT8510P(this.getDeviceType(), this.getSerial()) ||
|
|
15494
15518
|
device_1.Device.isLockWifiT8520P(this.getDeviceType(), this.getSerial()) ||
|
|
15495
|
-
device_1.Device.isLockWifiT85V0(this.getDeviceType()
|
|
15519
|
+
device_1.Device.isLockWifiT85V0(this.getDeviceType()) ||
|
|
15496
15520
|
device_1.Device.isLockWifiT85L0(this.getDeviceType())) {
|
|
15497
15521
|
logging_1.rootHTTPLogger.debug(`Station smart lock send get lock status command`, { stationSN: this.getSerial() });
|
|
15498
15522
|
const command = (0, utils_2.getSmartLockP2PCommand)(this.rawStation.station_sn, this.rawStation.member.admin_user_id, types_2.SmartLockCommand.QUERY_STATUS_IN_LOCK, 0, this.p2pSession.incLockSequenceNumber(), device_1.Lock.encodeCmdSmartLockStatus(this.rawStation.member.admin_user_id));
|
|
@@ -15532,6 +15556,9 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
15532
15556
|
serialnumber: serialnumber,
|
|
15533
15557
|
});
|
|
15534
15558
|
}
|
|
15559
|
+
onHubNotifyUpdate() {
|
|
15560
|
+
this.emit("hub notify update", this);
|
|
15561
|
+
}
|
|
15535
15562
|
updateUsername(device, username, passwordId) {
|
|
15536
15563
|
const commandData = {
|
|
15537
15564
|
name: types_1.CommandName.DeviceUpdateUsername,
|