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,7 +204,8 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
204
204
  const val = value;
205
205
  if (property.key === types_1.ParamType.PRIVATE_MODE ||
206
206
  property.key === types_1.ParamType.OPEN_DEVICE ||
207
- property.key === types_2.CommandType.CMD_DEVS_SWITCH) {
207
+ property.key === types_2.CommandType.CMD_DEVS_SWITCH ||
208
+ property.key === types_2.CommandType.CMD_INDOOR_ENABLE_PRIVACY_MODE_S350) {
208
209
  if ((this.isIndoorCamera() && !this.isIndoorPanAndTiltCameraS350()) ||
209
210
  (this.isWiredDoorbell() && !this.isWiredDoorbellT8200X()) ||
210
211
  this.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8422 ||
@@ -1432,6 +1433,9 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
1432
1433
  else if (property.name === types_1.PropertyName.Model && this.isLockWifiT85V0()) {
1433
1434
  return "T85V0";
1434
1435
  }
1436
+ else if (property.name === types_1.PropertyName.Model && this.isLockWifiT85P0()) {
1437
+ return "T85P0";
1438
+ }
1435
1439
  else if (property.type === "number") {
1436
1440
  const numericProperty = property;
1437
1441
  try {
@@ -1630,7 +1634,16 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
1630
1634
  types_1.DeviceDetectionStatisticsRecordedEventsProperty;
1631
1635
  if (!this.isSmartDrop()) {
1632
1636
  //TODO: Check with future devices if this property overriding is correct (for example with indoor cameras etc.)
1633
- newMetadata[types_1.PropertyName.DeviceEnabled] = types_1.DeviceEnabledSoloProperty;
1637
+ // Outdoor pan/tilt cams (eufyCam S4 etc.) report enabled state
1638
+ // through the wrapped CMD_INDOOR_ENABLE_PRIVACY_MODE_S350 (6250)
1639
+ // param. Binding them to DeviceEnabledSoloProperty (key=1035) here
1640
+ // would re-anchor the read on a value the cam never updates again.
1641
+ if (this.isOutdoorPanAndTiltCamera()) {
1642
+ newMetadata[types_1.PropertyName.DeviceEnabled] = types_1.DeviceEnabledIndoorS350Property;
1643
+ }
1644
+ else {
1645
+ newMetadata[types_1.PropertyName.DeviceEnabled] = types_1.DeviceEnabledSoloProperty;
1646
+ }
1634
1647
  }
1635
1648
  metadata = newMetadata;
1636
1649
  }
@@ -1747,7 +1760,8 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
1747
1760
  type == types_1.DeviceType.INDOOR_PT_CAMERA_C220 ||
1748
1761
  type == types_1.DeviceType.INDOOR_PT_CAMERA_C220_V2 ||
1749
1762
  type == types_1.DeviceType.SOLOCAM_E42 ||
1750
- type == types_1.DeviceType.SMART_DROP);
1763
+ type == types_1.DeviceType.SMART_DROP ||
1764
+ type == types_1.DeviceType.CAMERA_POE_S4);
1751
1765
  }
1752
1766
  static hasBattery(type) {
1753
1767
  return (type == types_1.DeviceType.CAMERA ||
@@ -1789,6 +1803,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
1789
1803
  type == types_1.DeviceType.LOCK_85V0 ||
1790
1804
  type == types_1.DeviceType.LOCK_8502 ||
1791
1805
  type == types_1.DeviceType.LOCK_85L0 ||
1806
+ type == types_1.DeviceType.LOCK_85P0 ||
1792
1807
  type == types_1.DeviceType.SMART_SAFE_7400 ||
1793
1808
  type == types_1.DeviceType.SMART_SAFE_7401 ||
1794
1809
  type == types_1.DeviceType.SMART_SAFE_7402 ||
@@ -1805,7 +1820,8 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
1805
1820
  return (type === types_1.DeviceType.STATION ||
1806
1821
  type === types_1.DeviceType.HB3 ||
1807
1822
  type === types_1.DeviceType.HOMEBASE_MINI ||
1808
- type === types_1.DeviceType.MINIBASE_CHIME);
1823
+ type === types_1.DeviceType.MINIBASE_CHIME ||
1824
+ type === types_1.DeviceType.NVR_S4_MAX);
1809
1825
  }
1810
1826
  static isCamera1(type) {
1811
1827
  return types_1.DeviceType.CAMERA == type;
@@ -1813,6 +1829,9 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
1813
1829
  static isCameraE(type) {
1814
1830
  return types_1.DeviceType.CAMERA_E == type;
1815
1831
  }
1832
+ static isIndoorCameraBase(type) {
1833
+ return types_1.DeviceType.INDOOR_CAMERA == type;
1834
+ }
1816
1835
  static isSensor(type) {
1817
1836
  if (type == types_1.DeviceType.SENSOR || type == types_1.DeviceType.MOTION_SENSOR || type == types_1.DeviceType.ENTRY_SENSOR_E20)
1818
1837
  return true;
@@ -1887,7 +1906,8 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
1887
1906
  type == types_1.DeviceType.INDOOR_PT_CAMERA_E30 ||
1888
1907
  type == types_1.DeviceType.INDOOR_PT_CAMERA_C210 ||
1889
1908
  type == types_1.DeviceType.INDOOR_PT_CAMERA_C220 ||
1890
- type == types_1.DeviceType.INDOOR_PT_CAMERA_C220_V2)
1909
+ type == types_1.DeviceType.INDOOR_PT_CAMERA_C220_V2 ||
1910
+ type == types_1.DeviceType.CAMERA_POE_S4)
1891
1911
  return true;
1892
1912
  return false;
1893
1913
  }
@@ -1932,6 +1952,11 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
1932
1952
  return true;
1933
1953
  return false;
1934
1954
  }
1955
+ static isFloodLightT8424(type) {
1956
+ if (type == types_1.DeviceType.FLOODLIGHT_CAMERA_8424)
1957
+ return true;
1958
+ return false;
1959
+ }
1935
1960
  static isFloodLightT8425(type) {
1936
1961
  if (type == types_1.DeviceType.FLOODLIGHT_CAMERA_8425)
1937
1962
  return true;
@@ -1954,11 +1979,12 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
1954
1979
  Device.isLockWifiR20(type) ||
1955
1980
  Device.isLockWifiVideo(type) ||
1956
1981
  Device.isLockWifiT8506(type) ||
1957
- Device.isLockWifiT85V0(type, "") ||
1982
+ Device.isLockWifiT85V0(type) ||
1958
1983
  Device.isLockWifiT8502(type) ||
1959
1984
  Device.isLockWifiT85L0(type) ||
1960
1985
  Device.isLockWifiT8531(type) ||
1961
- Device.isLockWifiT85D0(type));
1986
+ Device.isLockWifiT85D0(type) ||
1987
+ Device.isLockWifiT85P0(type));
1962
1988
  }
1963
1989
  static isLockKeypad(type) {
1964
1990
  return Device.isLockWifiR10Keypad(type) || Device.isLockWifiR20Keypad(type);
@@ -1984,6 +2010,10 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
1984
2010
  static isLockWifiT85D0(type) {
1985
2011
  return types_1.DeviceType.LOCK_85D0 == type;
1986
2012
  }
2013
+ static isLockWifiT85P0(type) {
2014
+ //T85P0
2015
+ return types_1.DeviceType.LOCK_85P0 == type;
2016
+ }
1987
2017
  static isLockWifiR10(type) {
1988
2018
  return types_1.DeviceType.LOCK_8503 == type;
1989
2019
  }
@@ -2021,13 +2051,8 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
2021
2051
  return true;
2022
2052
  return false;
2023
2053
  }
2024
- static isLockWifiT85V0(type, serialnumber) {
2025
- if (type == types_1.DeviceType.LOCK_85V0 &&
2026
- serialnumber.startsWith("T85V0") &&
2027
- serialnumber.length > 6 &&
2028
- serialnumber.charAt(6) === "9")
2029
- return true;
2030
- return false;
2054
+ static isLockWifiT85V0(type) {
2055
+ return types_1.DeviceType.LOCK_85V0 == type;
2031
2056
  }
2032
2057
  static isLockWifiT85L0(type) {
2033
2058
  return types_1.DeviceType.LOCK_85L0 == type;
@@ -2088,6 +2113,9 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
2088
2113
  static isCameraC35(type) {
2089
2114
  return types_1.DeviceType.CAMERA_C35 == type;
2090
2115
  }
2116
+ static isIndoorPTCameraE30(type) {
2117
+ return types_1.DeviceType.INDOOR_PT_CAMERA_E30 == type;
2118
+ }
2091
2119
  static isSoloCameraE30(type) {
2092
2120
  return types_1.DeviceType.SOLO_CAMERA_E30 == type;
2093
2121
  }
@@ -2251,6 +2279,7 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
2251
2279
  return (sn.startsWith("T8510") ||
2252
2280
  sn.startsWith("T8520") ||
2253
2281
  sn.startsWith("T85V0") ||
2282
+ sn.startsWith("T85P0") ||
2254
2283
  sn.startsWith("T8500") ||
2255
2284
  sn.startsWith("T8501") ||
2256
2285
  sn.startsWith("T8503") ||
@@ -2302,9 +2331,20 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
2302
2331
  return true;
2303
2332
  return false;
2304
2333
  }
2334
+ static isCameraPoE(type) {
2335
+ //T8E00
2336
+ return types_1.DeviceType.CAMERA_POE_S4 === type;
2337
+ }
2338
+ static isNVR(type) {
2339
+ //T8N00
2340
+ return types_1.DeviceType.NVR_S4_MAX === type;
2341
+ }
2305
2342
  isCamera() {
2306
2343
  return Device.isCamera(this.rawDevice.device_type);
2307
2344
  }
2345
+ isIndoorCameraBase() {
2346
+ return Device.isIndoorCameraBase(this.rawDevice.device_type);
2347
+ }
2308
2348
  isFloodLight() {
2309
2349
  return Device.isFloodLight(this.rawDevice.device_type);
2310
2350
  }
@@ -2314,6 +2354,9 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
2314
2354
  isFloodLightT8423() {
2315
2355
  return Device.isFloodLightT8423(this.rawDevice.device_type);
2316
2356
  }
2357
+ isFloodLightT8424() {
2358
+ return Device.isFloodLightT8424(this.rawDevice.device_type);
2359
+ }
2317
2360
  isFloodLightT8425() {
2318
2361
  return Device.isFloodLightT8425(this.rawDevice.device_type);
2319
2362
  }
@@ -2381,11 +2424,14 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
2381
2424
  return Device.isLockWifiT8531(this.rawDevice.device_type);
2382
2425
  }
2383
2426
  isLockWifiT85V0() {
2384
- return Device.isLockWifiT85V0(this.rawDevice.device_type, this.rawDevice.device_sn);
2427
+ return Device.isLockWifiT85V0(this.rawDevice.device_type);
2385
2428
  }
2386
2429
  isLockWifiT85L0() {
2387
2430
  return Device.isLockWifiT85L0(this.rawDevice.device_type);
2388
2431
  }
2432
+ isLockWifiT85P0() {
2433
+ return Device.isLockWifiT85P0(this.rawDevice.device_type);
2434
+ }
2389
2435
  isBatteryDoorbell1() {
2390
2436
  return Device.isBatteryDoorbell1(this.rawDevice.device_type);
2391
2437
  }
@@ -2434,6 +2480,9 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
2434
2480
  isCameraC35() {
2435
2481
  return Device.isCameraC35(this.rawDevice.device_type);
2436
2482
  }
2483
+ isIndoorPTCameraE30() {
2484
+ return Device.isIndoorPTCameraE30(this.rawDevice.device_type);
2485
+ }
2437
2486
  isSoloCameraE30() {
2438
2487
  return Device.isSoloCameraE30(this.rawDevice.device_type);
2439
2488
  }
@@ -2550,6 +2599,12 @@ class Device extends tiny_typed_emitter_1.TypedEmitter {
2550
2599
  isSmartTrackLink() {
2551
2600
  return Device.isSmartTrackLink(this.rawDevice.device_type);
2552
2601
  }
2602
+ isCameraPoE() {
2603
+ return Device.isCameraPoE(this.rawDevice.device_type);
2604
+ }
2605
+ isNVR() {
2606
+ return Device.isNVR(this.rawDevice.device_type);
2607
+ }
2553
2608
  hasBattery() {
2554
2609
  return Device.hasBattery(this.rawDevice.device_type);
2555
2610
  }