eufy-security-client 3.8.0 → 4.0.0-dev.30

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.
Files changed (44) hide show
  1. package/README.md +24 -0
  2. package/build/eufysecurity.d.ts +2 -0
  3. package/build/eufysecurity.js +17 -0
  4. package/build/eufysecurity.js.map +1 -1
  5. package/build/http/api.d.ts +2 -0
  6. package/build/http/api.js +39 -6
  7. package/build/http/api.js.map +1 -1
  8. package/build/http/device.d.ts +13 -1
  9. package/build/http/device.js +70 -15
  10. package/build/http/device.js.map +1 -1
  11. package/build/http/interfaces.d.ts +1 -0
  12. package/build/http/models.d.ts +1 -0
  13. package/build/http/station.d.ts +9 -1
  14. package/build/http/station.js +108 -31
  15. package/build/http/station.js.map +1 -1
  16. package/build/http/types.d.ts +4 -0
  17. package/build/http/types.js +218 -7
  18. package/build/http/types.js.map +1 -1
  19. package/build/p2p/adts.d.ts +12 -0
  20. package/build/p2p/adts.js +185 -0
  21. package/build/p2p/adts.js.map +1 -0
  22. package/build/p2p/interfaces.d.ts +10 -0
  23. package/build/p2p/session.d.ts +3 -1
  24. package/build/p2p/session.js +138 -30
  25. package/build/p2p/session.js.map +1 -1
  26. package/build/p2p/types.d.ts +1 -0
  27. package/build/p2p/types.js +1 -0
  28. package/build/p2p/types.js.map +1 -1
  29. package/build/p2p/utils.d.ts +11 -0
  30. package/build/p2p/utils.js +76 -4
  31. package/build/p2p/utils.js.map +1 -1
  32. package/coverage/clover.xml +8665 -8452
  33. package/coverage/coverage-final.json +32 -31
  34. package/coverage/lcov-report/index.html +41 -41
  35. package/coverage/lcov.info +17294 -15644
  36. package/package.json +7 -7
  37. package/.idea/eufy-security-client.iml +0 -12
  38. package/.idea/modules.xml +0 -8
  39. package/.idea/vcs.xml +0 -7
  40. package/bin/act +0 -0
  41. package/coverage/lcov-report/cache.ts.html +0 -184
  42. package/coverage/lcov-report/error.ts.html +0 -871
  43. package/coverage/lcov-report/logging.ts.html +0 -598
  44. package/dont-care.js +0 -101
@@ -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;
@@ -382,6 +382,7 @@ export interface Cipher {
382
382
  cipher_id: number;
383
383
  user_id: string;
384
384
  private_key: string;
385
+ ecc_private_key?: string;
385
386
  }
386
387
  export interface Voice {
387
388
  voice_id: number;
@@ -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;
@@ -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,8 @@ 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, stationData.station_sn)) {
103
+ !device_1.Device.isLockWifiT85V0(stationData.device_type) &&
104
+ !device_1.Device.isLockWifiT85P0(stationData.device_type)) {
103
105
  publicKey = await api.getPublicKey(stationData.station_sn, types_1.PublicKeyType.LOCK);
104
106
  }
105
107
  return new Station(api, stationData, ipAddress, listeningPort, publicKey, enableEmbeddedPKCS1Support);
@@ -406,8 +408,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
406
408
  if (property.name === types_1.PropertyName.Model && device_1.Device.isLockWifiT8510P(this.getDeviceType(), this.getSerial())) {
407
409
  return "T8510P";
408
410
  }
409
- else if (property.name === types_1.PropertyName.Model &&
410
- device_1.Device.isLockWifiT85V0(this.getDeviceType(), this.getSerial())) {
411
+ else if (property.name === types_1.PropertyName.Model && device_1.Device.isLockWifiT85V0(this.getDeviceType())) {
411
412
  return "T85V0";
412
413
  }
413
414
  else if (property.type === "number") {
@@ -561,7 +562,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
561
562
  return (type === types_1.DeviceType.STATION ||
562
563
  type === types_1.DeviceType.HB3 ||
563
564
  type === types_1.DeviceType.MINIBASE_CHIME ||
564
- type === types_1.DeviceType.HOMEBASE_MINI);
565
+ type === types_1.DeviceType.HOMEBASE_MINI ||
566
+ type === types_1.DeviceType.NVR_S4_MAX);
565
567
  }
566
568
  isStation() {
567
569
  return Station.isStation(this.rawStation.device_type);
@@ -575,12 +577,24 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
575
577
  static isStationHomeBaseMini(type) {
576
578
  return type === types_1.DeviceType.HOMEBASE_MINI;
577
579
  }
580
+ static isStationNVR(type) {
581
+ return type === types_1.DeviceType.NVR_S4_MAX;
582
+ }
578
583
  static isStationHomeBase3BySn(sn) {
579
584
  return sn.startsWith("T8030");
580
585
  }
581
586
  static isStationHomeBaseMiniBySn(sn) {
582
587
  return sn.startsWith("T8025");
583
588
  }
589
+ static isStationMiniBaseChime(type) {
590
+ return type === types_1.DeviceType.MINIBASE_CHIME;
591
+ }
592
+ static isStationMiniBaseChimeBySn(sn) {
593
+ return sn.startsWith("T8023");
594
+ }
595
+ static isStationNVRBySn(sn) {
596
+ return sn.startsWith("T8N00");
597
+ }
584
598
  isStationHomeBase2OrOlder() {
585
599
  return Station.isStationHomeBase2OrOlder(this.rawStation.device_type);
586
600
  }
@@ -590,6 +604,12 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
590
604
  isStationHomeBaseMini() {
591
605
  return Station.isStationHomeBaseMini(this.rawStation.device_type);
592
606
  }
607
+ isStationMiniBaseChime() {
608
+ return Station.isStationMiniBaseChime(this.rawStation.device_type);
609
+ }
610
+ isStationNVR() {
611
+ return Station.isStationNVR(this.rawStation.device_type);
612
+ }
593
613
  /**
594
614
  * Checks if the station is a HomeBase 3 or HomeBase mini for determining if SoloDevices are connected to a supported HomeBase.
595
615
  * @returns Returns true, if this is a HomeBase 3 or a HomeBase mini, otherwise false.
@@ -6373,6 +6393,29 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
6373
6393
  property: propertyData,
6374
6394
  });
6375
6395
  }
6396
+ else if (device.isOutdoorPanAndTiltCamera()) {
6397
+ // Outdoor pan/tilt cams (eufyCam S4 / T8172 etc.) behind a HomeBase 3
6398
+ // silently drop raw CMD_DEVS_SWITCH frames. Pcap comparison against
6399
+ // the iOS Eufy app shows they accept the same wrapped envelope as
6400
+ // INDOOR_PT_CAMERA_S350 — outer CMD_SET_PAYLOAD carrying inner
6401
+ // CMD_INDOOR_ENABLE_PRIVACY_MODE_S350.
6402
+ param_value = value === true ? 0 : 1;
6403
+ this.p2pSession.sendCommandWithStringPayload({
6404
+ commandType: types_2.CommandType.CMD_SET_PAYLOAD,
6405
+ value: JSON.stringify({
6406
+ account_id: this.rawStation.member.admin_user_id,
6407
+ cmd: types_2.CommandType.CMD_INDOOR_ENABLE_PRIVACY_MODE_S350,
6408
+ mChannel: device.getChannel(),
6409
+ mValue3: 0,
6410
+ payload: {
6411
+ switch: param_value,
6412
+ },
6413
+ }),
6414
+ channel: device.getChannel(),
6415
+ }, {
6416
+ property: propertyData,
6417
+ });
6418
+ }
6376
6419
  else {
6377
6420
  this.p2pSession.sendCommandWithIntString({
6378
6421
  commandType: types_2.CommandType.CMD_DEVS_SWITCH,
@@ -6592,7 +6635,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
6592
6635
  command: commandData,
6593
6636
  });
6594
6637
  }
6595
- else if (device.isOutdoorPanAndTiltCamera() || device.isBatteryDoorbellDualE340() || device.isFloodLightT8425()) {
6638
+ else if (device.isOutdoorPanAndTiltCamera() ||
6639
+ device.isFloodLightT8425() ||
6640
+ (device.isBatteryDoorbellDualE340() && !this.isStationMiniBaseChime()) ||
6641
+ ((device.isIndoorPTCameraE30() || device.isIndoorCameraBase()) && this.isDeviceControlledByHomeBase())) {
6596
6642
  logging_1.rootHTTPLogger.debug(`Station start livestream - sending command using CMD_DOORBELL_SET_PAYLOAD (1)`, {
6597
6643
  stationSN: this.getSerial(),
6598
6644
  deviceSN: device.getSerial(),
@@ -6617,9 +6663,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
6617
6663
  });
6618
6664
  }
6619
6665
  else if (device.isSoloCameras() ||
6620
- device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 ||
6621
- device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8424 ||
6622
- device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8424 ||
6666
+ device.isFloodLightT8423() ||
6667
+ device.isFloodLightT8424() ||
6623
6668
  device.isWiredDoorbellT8200X() ||
6624
6669
  device.isWallLightCam() ||
6625
6670
  device.isGarageCamera()) {
@@ -6847,6 +6892,9 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
6847
6892
  return false;
6848
6893
  return this.p2pSession.isLiveStreaming(device.getChannel());
6849
6894
  }
6895
+ setStreamTimeouts(options) {
6896
+ this.p2pSession.setStreamTimeouts(options);
6897
+ }
6850
6898
  isDownloading(device) {
6851
6899
  if (device.getStationSerial() !== this.getSerial())
6852
6900
  return false;
@@ -7341,7 +7389,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
7341
7389
  device.isLockWifiT8510P() ||
7342
7390
  device.isLockWifiT8520P() ||
7343
7391
  device.isLockWifiT85L0() ||
7344
- device.isLockWifiT85V0()) {
7392
+ device.isLockWifiT85V0() ||
7393
+ device.isLockWifiT85P0()) {
7345
7394
  const command = (0, utils_2.getSmartLockP2PCommand)(this.rawStation.station_sn, this.rawStation.member.admin_user_id, types_2.SmartLockCommand.ON_OFF_LOCK, device.getChannel(), this.p2pSession.incLockSequenceNumber(), device_1.Lock.encodeCmdSmartLockUnlock(this.rawStation.member.admin_user_id, value, this.rawStation.member.nick_name, this.rawStation.member.short_user_id));
7346
7395
  logging_1.rootHTTPLogger.debug("Station lock device - Locking/unlocking device...", {
7347
7396
  station: this.getSerial(),
@@ -8861,7 +8910,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
8861
8910
  device.isLockWifiT8510P() ||
8862
8911
  device.isLockWifiT8520P() ||
8863
8912
  device.isLockWifiT85L0() ||
8864
- device.isLockWifiT85V0()) {
8913
+ device.isLockWifiT85V0() ||
8914
+ device.isLockWifiT85P0()) {
8865
8915
  const command = (0, utils_2.getSmartLockP2PCommand)(this.rawStation.station_sn, this.rawStation.member.admin_user_id, types_2.SmartLockCommand.ON_OFF_LOCK, device.getChannel(), this.p2pSession.incLockSequenceNumber(), device_1.Lock.encodeCmdSmartLockCalibrate(this.rawStation.member.admin_user_id));
8866
8916
  logging_1.rootHTTPLogger.debug("Station calibrate lock - Calibrate lock...", {
8867
8917
  station: this.getSerial(),
@@ -10832,6 +10882,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
10832
10882
  device.isWallLightCam() ||
10833
10883
  device.isGarageCamera() ||
10834
10884
  device.isOutdoorPanAndTiltCamera() ||
10885
+ device.isBatteryDoorbellDualE340() ||
10835
10886
  (device.isIndoorPanAndTiltCameraS350() && !this.isDeviceControlledByHomeBase())) {
10836
10887
  this.p2pSession.sendCommandWithStringPayload({
10837
10888
  commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
@@ -10900,6 +10951,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
10900
10951
  device.isWallLightCam() ||
10901
10952
  device.isGarageCamera() ||
10902
10953
  device.isOutdoorPanAndTiltCamera() ||
10954
+ device.isBatteryDoorbellDualE340() ||
10903
10955
  (device.isIndoorPanAndTiltCameraS350() && !this.isDeviceControlledByHomeBase())) {
10904
10956
  this.p2pSession.sendCommandWithStringPayload({
10905
10957
  commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
@@ -10992,7 +11044,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
10992
11044
  device.isLockWifiT8510P() ||
10993
11045
  device.isLockWifiT8520P() ||
10994
11046
  device.isLockWifiT85L0() ||
10995
- device.isLockWifiT85V0()) {
11047
+ device.isLockWifiT85V0() ||
11048
+ device.isLockWifiT85P0()) {
10996
11049
  this.setSmartLockParams(device, types_1.PropertyName.DeviceScramblePasscode, value);
10997
11050
  }
10998
11051
  else if (device.isSmartSafe()) {
@@ -11050,7 +11103,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
11050
11103
  device.isLockWifiT8510P() ||
11051
11104
  device.isLockWifiT8520P() ||
11052
11105
  device.isLockWifiT85L0() ||
11053
- device.isLockWifiT85V0()) {
11106
+ device.isLockWifiT85V0() ||
11107
+ device.isLockWifiT85P0()) {
11054
11108
  this.setSmartLockParams(device, types_1.PropertyName.DeviceWrongTryProtection, value);
11055
11109
  }
11056
11110
  else if (device.isSmartSafe()) {
@@ -11108,7 +11162,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
11108
11162
  device.isLockWifiT8510P() ||
11109
11163
  device.isLockWifiT8520P() ||
11110
11164
  device.isLockWifiT85L0() ||
11111
- device.isLockWifiT85V0()) {
11165
+ device.isLockWifiT85V0() ||
11166
+ device.isLockWifiT85P0()) {
11112
11167
  this.setSmartLockParams(device, types_1.PropertyName.DeviceWrongTryAttempts, value);
11113
11168
  }
11114
11169
  else if (device.isSmartSafe()) {
@@ -11166,7 +11221,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
11166
11221
  device.isLockWifiT8510P() ||
11167
11222
  device.isLockWifiT8520P() ||
11168
11223
  device.isLockWifiT85L0() ||
11169
- device.isLockWifiT85V0()) {
11224
+ device.isLockWifiT85V0() ||
11225
+ device.isLockWifiT85P0()) {
11170
11226
  this.setSmartLockParams(device, types_1.PropertyName.DeviceWrongTryLockdownTime, value);
11171
11227
  }
11172
11228
  else if (device.isSmartSafe()) {
@@ -11705,7 +11761,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
11705
11761
  device.isLockWifiT8510P() ||
11706
11762
  device.isLockWifiT8520P() ||
11707
11763
  device.isLockWifiT85L0() ||
11708
- device.isLockWifiT85V0()) {
11764
+ device.isLockWifiT85V0() ||
11765
+ device.isLockWifiT85P0()) {
11709
11766
  const command = (0, utils_2.getSmartLockP2PCommand)(this.rawStation.station_sn, this.rawStation.member.admin_user_id, types_2.SmartLockCommand.ADD_PW, device.getChannel(), this.p2pSession.incLockSequenceNumber(), device_1.Lock.encodeCmdSmartLockAddUser(this.rawStation.member.admin_user_id, shortUserId, (0, utils_1.encodePasscode)(passcode), username, schedule));
11710
11767
  logging_1.rootHTTPLogger.debug("Station smart lock device - Add user...", {
11711
11768
  station: this.getSerial(),
@@ -11821,7 +11878,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
11821
11878
  device.isLockWifiT8510P() ||
11822
11879
  device.isLockWifiT8520P() ||
11823
11880
  device.isLockWifiT85L0() ||
11824
- device.isLockWifiT85V0()) {
11881
+ device.isLockWifiT85V0() ||
11882
+ device.isLockWifiT85P0()) {
11825
11883
  const command = (0, utils_2.getSmartLockP2PCommand)(this.rawStation.station_sn, this.rawStation.member.admin_user_id, types_2.SmartLockCommand.DELETE_USER, device.getChannel(), this.p2pSession.incLockSequenceNumber(), device_1.Lock.encodeCmdSmartLockDeleteUser(this.rawStation.member.admin_user_id, shortUserId));
11826
11884
  logging_1.rootHTTPLogger.debug("Station delete user - payload", {
11827
11885
  station: this.getSerial(),
@@ -11951,7 +12009,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
11951
12009
  device.isLockWifiT8510P() ||
11952
12010
  device.isLockWifiT8520P() ||
11953
12011
  device.isLockWifiT85L0() ||
11954
- device.isLockWifiT85V0()) {
12012
+ device.isLockWifiT85V0() ||
12013
+ device.isLockWifiT85P0()) {
11955
12014
  const command = (0, utils_2.getSmartLockP2PCommand)(this.rawStation.station_sn, this.rawStation.member.admin_user_id, types_2.SmartLockCommand.UPDATE_USER_TIME, device.getChannel(), this.p2pSession.incLockSequenceNumber(), device_1.Lock.encodeCmdSmartLockUpdateSchedule(this.rawStation.member.admin_user_id, shortUserId, username, schedule));
11956
12015
  logging_1.rootHTTPLogger.debug("Station update user schedule - payload", {
11957
12016
  station: this.getSerial(),
@@ -12080,7 +12139,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12080
12139
  device.isLockWifiT8510P() ||
12081
12140
  device.isLockWifiT8520P() ||
12082
12141
  device.isLockWifiT85L0() ||
12083
- device.isLockWifiT85V0()) {
12142
+ device.isLockWifiT85V0() ||
12143
+ device.isLockWifiT85P0()) {
12084
12144
  const command = (0, utils_2.getSmartLockP2PCommand)(this.rawStation.station_sn, this.rawStation.member.admin_user_id, types_2.SmartLockCommand.UPDATE_PW, device.getChannel(), this.p2pSession.incLockSequenceNumber(), device_1.Lock.encodeCmdSmartLockModifyPassword(this.rawStation.member.admin_user_id, passwordId, (0, utils_1.encodePasscode)(passcode)));
12085
12145
  logging_1.rootHTTPLogger.debug("Station update user passcode - payload", {
12086
12146
  station: this.getSerial(),
@@ -12237,7 +12297,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12237
12297
  device.isLockWifiT8510P() ||
12238
12298
  device.isLockWifiT8520P() ||
12239
12299
  device.isLockWifiT85L0() ||
12240
- device.isLockWifiT85V0()) {
12300
+ device.isLockWifiT85V0() ||
12301
+ device.isLockWifiT85P0()) {
12241
12302
  let payload;
12242
12303
  switch (property) {
12243
12304
  case types_1.PropertyName.DeviceWrongTryProtection:
@@ -12341,7 +12402,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12341
12402
  device.isLockWifiT8510P() ||
12342
12403
  device.isLockWifiT8520P() ||
12343
12404
  device.isLockWifiT85L0() ||
12344
- device.isLockWifiT85V0()) {
12405
+ device.isLockWifiT85V0() ||
12406
+ device.isLockWifiT85P0()) {
12345
12407
  this.setSmartLockParams(device, types_1.PropertyName.DeviceAutoLock, value);
12346
12408
  }
12347
12409
  else {
@@ -12396,7 +12458,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12396
12458
  device.isLockWifiT8510P() ||
12397
12459
  device.isLockWifiT8520P() ||
12398
12460
  device.isLockWifiT85L0() ||
12399
- device.isLockWifiT85V0()) {
12461
+ device.isLockWifiT85V0() ||
12462
+ device.isLockWifiT85P0()) {
12400
12463
  this.setSmartLockParams(device, types_1.PropertyName.DeviceAutoLockSchedule, value);
12401
12464
  }
12402
12465
  else {
@@ -12451,7 +12514,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12451
12514
  device.isLockWifiT8510P() ||
12452
12515
  device.isLockWifiT8520P() ||
12453
12516
  device.isLockWifiT85L0() ||
12454
- device.isLockWifiT85V0()) {
12517
+ device.isLockWifiT85V0() ||
12518
+ device.isLockWifiT85P0()) {
12455
12519
  this.setSmartLockParams(device, types_1.PropertyName.DeviceAutoLockScheduleStartTime, value);
12456
12520
  }
12457
12521
  else {
@@ -12506,7 +12570,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12506
12570
  device.isLockWifiT8510P() ||
12507
12571
  device.isLockWifiT8520P() ||
12508
12572
  device.isLockWifiT85L0() ||
12509
- device.isLockWifiT85V0()) {
12573
+ device.isLockWifiT85V0() ||
12574
+ device.isLockWifiT85P0()) {
12510
12575
  this.setSmartLockParams(device, types_1.PropertyName.DeviceAutoLockScheduleEndTime, value);
12511
12576
  }
12512
12577
  else {
@@ -12561,7 +12626,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12561
12626
  device.isLockWifiT8510P() ||
12562
12627
  device.isLockWifiT8520P() ||
12563
12628
  device.isLockWifiT85L0() ||
12564
- device.isLockWifiT85V0()) {
12629
+ device.isLockWifiT85V0() ||
12630
+ device.isLockWifiT85P0()) {
12565
12631
  this.setSmartLockParams(device, types_1.PropertyName.DeviceAutoLockTimer, value);
12566
12632
  }
12567
12633
  else {
@@ -12616,7 +12682,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12616
12682
  device.isLockWifiT8510P() ||
12617
12683
  device.isLockWifiT8520P() ||
12618
12684
  device.isLockWifiT85L0() ||
12619
- device.isLockWifiT85V0()) {
12685
+ device.isLockWifiT85V0() ||
12686
+ device.isLockWifiT85P0()) {
12620
12687
  this.setSmartLockParams(device, types_1.PropertyName.DeviceOneTouchLocking, value);
12621
12688
  }
12622
12689
  else {
@@ -12671,7 +12738,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12671
12738
  device.isLockWifiT8510P() ||
12672
12739
  device.isLockWifiT8520P() ||
12673
12740
  device.isLockWifiT85L0() ||
12674
- device.isLockWifiT85V0()) {
12741
+ device.isLockWifiT85V0() ||
12742
+ device.isLockWifiT85P0()) {
12675
12743
  this.setSmartLockParams(device, types_1.PropertyName.DeviceSound, value);
12676
12744
  }
12677
12745
  else {
@@ -12736,6 +12804,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12736
12804
  device.isLockWifiT8520P() ||
12737
12805
  device.isLockWifiR10() ||
12738
12806
  device.isLockWifiT85L0() ||
12807
+ device.isLockWifiT85P0() ||
12739
12808
  device.isLockWifiR20()) {
12740
12809
  let oldvalue = 0;
12741
12810
  const rawproperty = device.getRawProperty(types_2.CommandType.CMD_DOORLOCK_SET_PUSH_MODE);
@@ -12815,6 +12884,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12815
12884
  device.isLockWifiT8520P() ||
12816
12885
  device.isLockWifiR10() ||
12817
12886
  device.isLockWifiT85L0() ||
12887
+ device.isLockWifiT85P0() ||
12818
12888
  device.isLockWifiR20()) {
12819
12889
  let oldvalue = 0;
12820
12890
  const rawproperty = device.getRawProperty(types_2.CommandType.CMD_DOORLOCK_SET_PUSH_MODE);
@@ -12894,6 +12964,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
12894
12964
  device.isLockWifiT8520P() ||
12895
12965
  device.isLockWifiR10() ||
12896
12966
  device.isLockWifiT85L0() ||
12967
+ device.isLockWifiT85P0() ||
12897
12968
  device.isLockWifiR20()) {
12898
12969
  let oldvalue = 0;
12899
12970
  const rawproperty = device.getRawProperty(types_2.CommandType.CMD_DOORLOCK_SET_PUSH_MODE);
@@ -13051,7 +13122,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
13051
13122
  device.isLockWifiT8510P() ||
13052
13123
  device.isLockWifiT8520P() ||
13053
13124
  device.isLockWifiT85L0() ||
13054
- device.isLockWifiT85V0()) {
13125
+ device.isLockWifiT85V0() ||
13126
+ device.isLockWifiT85P0()) {
13055
13127
  const command = (0, utils_2.getSmartLockP2PCommand)(this.rawStation.station_sn, this.rawStation.member.admin_user_id, types_2.SmartLockCommand.QUERY_ALL_USERS, device.getChannel(), this.p2pSession.incLockSequenceNumber(), device_1.Lock.encodeCmdSmartLockGetUserList(this.rawStation.member.admin_user_id));
13056
13128
  logging_1.rootHTTPLogger.debug("Station get user list - payload", {
13057
13129
  station: this.getSerial(),
@@ -15474,8 +15546,9 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
15474
15546
  device_1.Device.isLockWifiT8502(this.getDeviceType()) ||
15475
15547
  device_1.Device.isLockWifiT8510P(this.getDeviceType(), this.getSerial()) ||
15476
15548
  device_1.Device.isLockWifiT8520P(this.getDeviceType(), this.getSerial()) ||
15477
- device_1.Device.isLockWifiT85V0(this.getDeviceType(), this.getSerial()) ||
15478
- device_1.Device.isLockWifiT85L0(this.getDeviceType())) {
15549
+ device_1.Device.isLockWifiT85V0(this.getDeviceType()) ||
15550
+ device_1.Device.isLockWifiT85L0(this.getDeviceType()) ||
15551
+ device_1.Device.isLockWifiT85P0(this.getDeviceType())) {
15479
15552
  logging_1.rootHTTPLogger.debug(`Station smart lock send get lock parameters command`, { stationSN: this.getSerial() });
15480
15553
  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));
15481
15554
  this.p2pSession.sendCommandWithStringPayload(command.payload);
@@ -15492,8 +15565,9 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
15492
15565
  device_1.Device.isLockWifiT8502(this.getDeviceType()) ||
15493
15566
  device_1.Device.isLockWifiT8510P(this.getDeviceType(), this.getSerial()) ||
15494
15567
  device_1.Device.isLockWifiT8520P(this.getDeviceType(), this.getSerial()) ||
15495
- device_1.Device.isLockWifiT85V0(this.getDeviceType(), this.getSerial()) ||
15496
- device_1.Device.isLockWifiT85L0(this.getDeviceType())) {
15568
+ device_1.Device.isLockWifiT85V0(this.getDeviceType()) ||
15569
+ device_1.Device.isLockWifiT85L0(this.getDeviceType()) ||
15570
+ device_1.Device.isLockWifiT85P0(this.getDeviceType())) {
15497
15571
  logging_1.rootHTTPLogger.debug(`Station smart lock send get lock status command`, { stationSN: this.getSerial() });
15498
15572
  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));
15499
15573
  this.p2pSession.sendCommandWithStringPayload(command.payload);
@@ -15532,6 +15606,9 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
15532
15606
  serialnumber: serialnumber,
15533
15607
  });
15534
15608
  }
15609
+ onHubNotifyUpdate() {
15610
+ this.emit("hub notify update", this);
15611
+ }
15535
15612
  updateUsername(device, username, passwordId) {
15536
15613
  const commandData = {
15537
15614
  name: types_1.CommandName.DeviceUpdateUsername,