eufy-security-client 1.3.0 → 1.6.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.
Files changed (59) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +78 -29
  3. package/build/eufysecurity.d.ts +9 -1
  4. package/build/eufysecurity.js +266 -69
  5. package/build/eufysecurity.js.map +1 -1
  6. package/build/http/api.d.ts +16 -6
  7. package/build/http/api.js +465 -187
  8. package/build/http/api.js.map +1 -1
  9. package/build/http/device.d.ts +14 -10
  10. package/build/http/device.js +153 -59
  11. package/build/http/device.js.map +1 -1
  12. package/build/http/interfaces.d.ts +30 -7
  13. package/build/http/models.d.ts +170 -82
  14. package/build/http/station.d.ts +31 -9
  15. package/build/http/station.js +2348 -1002
  16. package/build/http/station.js.map +1 -1
  17. package/build/http/types.d.ts +69 -2
  18. package/build/http/types.js +496 -36
  19. package/build/http/types.js.map +1 -1
  20. package/build/http/utils.d.ts +9 -0
  21. package/build/http/utils.js +3041 -1
  22. package/build/http/utils.js.map +1 -1
  23. package/build/interfaces.d.ts +11 -1
  24. package/build/mqtt/interface.d.ts +6 -0
  25. package/build/mqtt/interface.js +3 -0
  26. package/build/mqtt/interface.js.map +1 -0
  27. package/build/mqtt/model.d.ts +24 -0
  28. package/build/mqtt/model.js +3 -0
  29. package/build/mqtt/model.js.map +1 -0
  30. package/build/mqtt/mqtt-eufy.crt +79 -0
  31. package/build/mqtt/proto/lock.proto +33 -0
  32. package/build/mqtt/service.d.ts +26 -0
  33. package/build/mqtt/service.js +157 -0
  34. package/build/mqtt/service.js.map +1 -0
  35. package/build/p2p/index.d.ts +2 -2
  36. package/build/p2p/index.js +2 -1
  37. package/build/p2p/index.js.map +1 -1
  38. package/build/p2p/interfaces.d.ts +14 -3
  39. package/build/p2p/models.d.ts +36 -3
  40. package/build/p2p/session.d.ts +16 -10
  41. package/build/p2p/session.js +271 -139
  42. package/build/p2p/session.js.map +1 -1
  43. package/build/p2p/types.d.ts +38 -2
  44. package/build/p2p/types.js +40 -2
  45. package/build/p2p/types.js.map +1 -1
  46. package/build/p2p/utils.d.ts +9 -7
  47. package/build/p2p/utils.js +68 -39
  48. package/build/p2p/utils.js.map +1 -1
  49. package/build/push/client.js +1 -1
  50. package/build/push/client.js.map +1 -1
  51. package/build/push/models.d.ts +10 -1
  52. package/build/push/models.js.map +1 -1
  53. package/build/push/service.d.ts +1 -0
  54. package/build/push/service.js +62 -32
  55. package/build/push/service.js.map +1 -1
  56. package/build/push/types.d.ts +15 -6
  57. package/build/push/types.js +12 -3
  58. package/build/push/types.js.map +1 -1
  59. package/package.json +9 -8
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 bropat <patrick.broetto@gmail.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 bropat <patrick.broetto@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # eufy-security-client
2
2
 
3
- ![Logo](img/eufy-security.png)
3
+ ![Logo](docs/_media/eufy-security.png)
4
4
 
5
5
  [![node](https://img.shields.io/node/v/eufy-security-client.svg)](https://www.npmjs.com/package/eufy-security-client)
6
6
  [![NPM version](http://img.shields.io/npm/v/eufy-security-client.svg)](https://www.npmjs.com/package/eufy-security-client)
7
7
  [![Downloads](https://img.shields.io/npm/dm/eufy-security-client.svg)](https://www.npmjs.com/package/eufy-security-client)
8
- [![Dependency Status](https://img.shields.io/david/bropat/eufy-security-client.svg)](https://david-dm.org/bropat/eufy-security-client)
8
+ [![Dependency Status](https://img.shields.io/librariesio/release/npm/eufy-security-client)](https://libraries.io/npm/eufy-security-client)
9
9
  [![Known Vulnerabilities](https://snyk.io/test/github/bropat/eufy-security-client/badge.svg)](https://snyk.io/test/github/bropat/eufy-security-client)
10
10
 
11
11
  [![NPM](https://nodei.co/npm/eufy-security-client.png?downloads=true)](https://nodei.co/npm/eufy-security-client/)
@@ -21,6 +21,7 @@ Credits go to them as well.
21
21
  If you appreciate my work and progress and want to support me, you can do it here:
22
22
 
23
23
  [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/E1E332Q6Z)
24
+ [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.me/pbroetto)
24
25
 
25
26
  ## Description
26
27
 
@@ -60,38 +61,13 @@ One client instance will show all devices from one Eufy Cloud account and allows
60
61
 
61
62
  ## Documentation
62
63
 
63
- * WIP
64
+ Look [here](https://bropat.github.io/eufy-security-client/).
64
65
 
65
66
  *As an example, you can look at the following projects: [ioBroker.eufy-security](https://github.com/bropat/ioBroker.eufy-security), [eufy-security-ws](https://github.com/bropat/eufy-security-ws), [eufy_security](https://github.com/fuatakgun/eufy_security)*
66
67
 
67
68
  ## Known working devices
68
69
 
69
- * HomeBase (T8001)
70
- * HomeBase E (T8002)
71
- * HomeBase 2 (T8010)
72
- * Smart Lock Wi-Fi Bridge (T8021)
73
- * eufyCam (T8111)
74
- * eufyCam E (T8112)
75
- * eufyCam 2 (T8114)
76
- * eufyCam 2C (T8113)
77
- * eufyCam 2 Pro (T8140)
78
- * eufyCam 2C Pro (T8141)
79
- * SoloCam E40 (T8131)
80
- * Floodlight Camera (T8420)
81
- * Floodlight Cam (T8422)
82
- * Floodlight Cam 2 (T8424)
83
- * Wired Doorbell 2k (T8200)
84
- * Wired Doorbell 1080p (T8201)
85
- * Battery Doorbell 2K (T8210)
86
- * Battery Doorbell 1080p (T8222)
87
- * Entry Sensor (T8900)
88
- * Motion sensor (T8910)
89
- * Indoor Cam Pan&Tilt 2K (T8410)
90
- * Indoor Cam 2K (T8400)
91
- * Indoor Cam Pan&Tilt 1080p (T8411)
92
- * Indoor Cam 1080p (T8401)
93
- * Smart Lock Front Door (T8500)
94
- * Keypad (T8960)
70
+ For a list of supported devices, please see [here](https://bropat.github.io/eufy-security-client/#/supported_devices).
95
71
 
96
72
  If more devices work (or also not) please report them by opening a GitHub issue.
97
73
 
@@ -101,6 +77,79 @@ Please use GitHub issues for this.
101
77
 
102
78
  ## Changelog
103
79
 
80
+ ### 1.6.1 (2022-02-05)
81
+
82
+ * (bropat) Fixed small issue on driver upgrade of persistence data (has no impact; error entry in log on first startup)
83
+
84
+ ### 1.6.0 (2022-02-05)
85
+
86
+ * (bropat) Supports new [Home Management](https://communitysecurity.eufylife.com/t/tips-for-eufy-security-app-v4-0/2420747) feature of Eufy Security 4.0
87
+ * (bropat) Added support for Smart Lock Touch & Wifi (T8520; #89)
88
+ * (bropat) Implemented Eufy MQTT notification subscription for Smart Lock Touch & Wifi (T8520)
89
+ * (bropat) Added auto lock setting for Smart Lock Touch & Wifi (T8520)
90
+ * (bropat) Added auto lock schedule setting for Smart Lock Touch & Wifi (T8520)
91
+ * (bropat) Added auto lock schedule start time setting for Smart Lock Touch & Wifi (T8520)
92
+ * (bropat) Added auto lock schedule end time setting for Smart Lock Touch & Wifi (T8520)
93
+ * (bropat) Added auto lock timer setting for Smart Lock Touch & Wifi (T8520)
94
+ * (bropat) Added notification setting for Smart Lock Touch & Wifi (T8520)
95
+ * (bropat) Added notification locked setting for Smart Lock Touch & Wifi (T8520)
96
+ * (bropat) Added notification unlocked setting for Smart Lock Touch & Wifi (T8520)
97
+ * (bropat) Added one touch locking setting for Smart Lock Touch & Wifi (T8520)
98
+ * (bropat) Added scramble passcode setting for Smart Lock Touch & Wifi (T8520)
99
+ * (bropat) Added sound setting for Smart Lock Touch & Wifi (T8520)
100
+ * (bropat) Added wrong try protection setting for Smart Lock Touch & Wifi (T8520)
101
+ * (bropat) Added wrong try attempts setting for Smart Lock Touch & Wifi (T8520)
102
+ * (bropat) Added wrong try lockdown time setting for Smart Lock Touch & Wifi (T8520)
103
+ * (bropat) Added lock/unlock command for Smart Lock Touch & Wifi (T8520)
104
+ * (bropat) Added lock calibration command for Smart Lock Touch & Wifi (T8520)
105
+ * (bropat) Improved p2p communication with energy saving devices
106
+ * (bropat) Added new HTTPApi methods supporting Eufy Security 4.0
107
+ * (bropat) Some small improvements were made to the HTTPApi
108
+ * (bropat) Fixed issue #97
109
+ * (bropat) Fixed issue #102
110
+ * (bropat) Fixed issue #109
111
+ * (bropat) Updated versions of the package dependencies
112
+
113
+ ### 1.5.0 (2021-12-19)
114
+
115
+ * (bropat) Added support for floodlight cam 2 pro (T8423)
116
+ * (bropat) Added motion detection range setting for floodlight cam 2 pro (T8423)
117
+ * (bropat) Added motion detection range standard sensitivity setting for floodlight cam 2 pro (T8423)
118
+ * (bropat) Added motion detection range advanced left sensitivity setting for floodlight cam 2 pro (T8423)
119
+ * (bropat) Added motion detection range advanced middle sensitivity setting for floodlight cam 2 pro (T8423)
120
+ * (bropat) Added motion detection range advanced right sensitivity setting for floodlight cam 2 pro (T8423)
121
+ * (bropat) Added motion detection range test mode setting for floodlight cam 2 pro (T8423)
122
+ * (bropat) Added motion tracking sensitivity setting for floodlight cam 2 pro (T8423)
123
+ * (bropat) Added motion auto-cruise setting for floodlight cam 2 pro (T8423)
124
+ * (bropat) Added motion out-of-view detection setting for floodlight cam 2 pro (T8423)
125
+ * (bropat) Added light setting color temperature manual setting for floodlight cam 2 pro (T8423)
126
+ * (bropat) Added light setting color temperature mamotion setting for floodlight cam 2 pro (T8423)
127
+ * (bropat) Added light setting color temperature schedule setting for floodlight cam 2 pro (T8423)
128
+ * (bropat) Added light setting motion activation mode setting for floodlight cam 2 pro (T8423)
129
+ * (bropat) Added video nightvision image adjustment setting for floodlight cam 2 pro (T8423)
130
+ * (bropat) Added video color nightvision setting for floodlight cam 2 pro (T8423)
131
+ * (bropat) Added auto calibration setting for floodlight cam 2 pro (T8423)
132
+ * (bropat) Added start/stop rtsp livestream command for floodlight cam 2 pro (T8423)
133
+ * (bropat) Added battery and wifi rssi properties to eufycam 1/E
134
+ * (bropat) Implemented another p2p-keepalive mechanism found in some floodlights (e.g. T8420)
135
+ * (bropat) Fixed support for floodlight (T8420) - tested with FW: 1.0.0.35 HW: 2.2
136
+ * (bropat) Fixed status led setting for floodlight (T8420)
137
+ * (bropat) Fixed motion detected setting for floodlight (T8420)
138
+ * (bropat) Fixed motion detected sensitivity setting for floodlight (T8420)
139
+ * (bropat) Fixed audio recording setting for floodlight (T8420)
140
+ * (bropat) Fixed enable/disable device for floodlight (T8420)
141
+ * (bropat) Fixed start livestream command for floodlight (T8420)
142
+ * (bropat) Fixed issue #79
143
+ * (bropat) Fixed issue #66
144
+ * (bropat) Fixed some other minor issues
145
+ * (bropat) Added docs (:construction:)
146
+ * (bropat) Updated versions of the package dependencies
147
+
148
+ ### 1.4.0 (2021-11-22)
149
+
150
+ * (bropat) Implemented captcha authentication mechanism (API v2)
151
+ * (bropat) Fixed issue #69
152
+
104
153
  ### 1.3.0 (2021-11-20)
105
154
 
106
155
  * (bropat) Implemented new encrypted authentication mechanism (API v2)
@@ -18,6 +18,7 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
18
18
  private cameraStationLivestreamTimeout;
19
19
  private cameraCloudLivestreamTimeout;
20
20
  private pushService;
21
+ private mqttService;
21
22
  private pushCloudRegistered;
22
23
  private pushCloudChecked;
23
24
  private persistentFile;
@@ -26,6 +27,7 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
26
27
  private refreshEufySecurityCloudTimeout?;
27
28
  private refreshEufySecurityP2PTimeout;
28
29
  constructor(config: EufySecurityConfig, log?: Logger);
30
+ private initMQTT;
29
31
  getPushService(): PushNotificationService;
30
32
  private addStation;
31
33
  private removeStation;
@@ -51,7 +53,7 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
51
53
  setCameraMaxLivestreamDuration(seconds: number): void;
52
54
  getCameraMaxLivestreamDuration(): number;
53
55
  registerPushNotifications(credentials?: Credentials, persistentIds?: string[]): Promise<void>;
54
- connect(verifyCode?: string | null): Promise<boolean>;
56
+ connect(verifyCodeOrCaptcha?: string | null, captchaId?: string | null): Promise<boolean>;
55
57
  getPushPersistentIds(): string[];
56
58
  private updateDeviceProperties;
57
59
  private onAPIClose;
@@ -86,10 +88,14 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
86
88
  private onStationGuardMode;
87
89
  private onStationCurrentMode;
88
90
  private onStationPropertyChanged;
91
+ private onStationPropertyRenewed;
89
92
  private onStationRawPropertyChanged;
93
+ private onStationRawPropertyRenewed;
90
94
  private onStationAlarmEvent;
91
95
  private onDevicePropertyChanged;
96
+ private onDevicePropertyRenewed;
92
97
  private onDeviceRawPropertyChanged;
98
+ private onDeviceRawPropertyRenewed;
93
99
  private onDeviceCryingDetected;
94
100
  private onDeviceSoundDetected;
95
101
  private onDevicePetDetected;
@@ -102,4 +108,6 @@ export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
102
108
  private onStationRuntimeState;
103
109
  private onStationChargingState;
104
110
  private onStationWifiRssi;
111
+ private onCaptchaRequest;
112
+ private onFloodlightManualSwitch;
105
113
  }