@camera.ui/camera-ui-eufy 0.0.2
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/CHANGELOG.md +8 -0
- package/CONTRIBUTING.md +1 -0
- package/LICENSE.md +22 -0
- package/README.md +1 -0
- package/config.schema.json +348 -0
- package/dist/camera.d.ts +21 -0
- package/dist/camera.js +121 -0
- package/dist/camera.js.map +1 -0
- package/dist/eufy/LocalLiveStreamManager.d.ts +31 -0
- package/dist/eufy/LocalLiveStreamManager.js +111 -0
- package/dist/eufy/LocalLiveStreamManager.js.map +1 -0
- package/dist/eufy/Talkback.d.ts +23 -0
- package/dist/eufy/Talkback.js +93 -0
- package/dist/eufy/Talkback.js.map +1 -0
- package/dist/eufy/utils.d.ts +22 -0
- package/dist/eufy/utils.js +103 -0
- package/dist/eufy/utils.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +402 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +36 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +259 -0
- package/dist/utils.js.map +1 -0
- package/example-config.json +13 -0
- package/package.json +64 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { Device, EufySecurity, P2PConnectionType } from 'eufy-security-client';
|
|
2
|
+
import { Camera } from './camera.js';
|
|
3
|
+
import { getCountryCode } from './utils.js';
|
|
4
|
+
export default class Eufy {
|
|
5
|
+
config;
|
|
6
|
+
logger;
|
|
7
|
+
api;
|
|
8
|
+
cameras = new Map();
|
|
9
|
+
eufyClients = new Map();
|
|
10
|
+
eufyCameras = new Map();
|
|
11
|
+
cleanOrphanedCamerasTimeout;
|
|
12
|
+
constructor(logger, api) {
|
|
13
|
+
this.logger = logger;
|
|
14
|
+
this.api = api;
|
|
15
|
+
this.config = api.configService.all();
|
|
16
|
+
this.config.homes = api.configService.get('homes', [], (value) => Array.isArray(value), false, true);
|
|
17
|
+
this.api.on('finishLaunching', this.start.bind(this));
|
|
18
|
+
this.api.on('shutdown', this.stop.bind(this));
|
|
19
|
+
}
|
|
20
|
+
configureCameras(cameras) {
|
|
21
|
+
for (const camera of cameras) {
|
|
22
|
+
this.cameras.set(camera.id, camera);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async onFormSubmit(actionId, home) {
|
|
26
|
+
switch (actionId) {
|
|
27
|
+
case 'onLogin':
|
|
28
|
+
case 'on2FA':
|
|
29
|
+
case 'onCaptcha':
|
|
30
|
+
try {
|
|
31
|
+
const reAuth = actionId === 'on2FA' || actionId === 'onCaptcha';
|
|
32
|
+
const connectionResponse = await this.tryLogin(home, reAuth);
|
|
33
|
+
const eufyClient = this.eufyClients.get(home.name);
|
|
34
|
+
eufyClient?.removeAllListeners();
|
|
35
|
+
if (connectionResponse.connected) {
|
|
36
|
+
this.refreshConfig(home);
|
|
37
|
+
this.connectHome(home);
|
|
38
|
+
}
|
|
39
|
+
const formResponse = this.createFormResponse(connectionResponse);
|
|
40
|
+
return formResponse;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const message = `Failed to Authenticate. Reason: ${error.message}`;
|
|
44
|
+
this.logger.error(home.name, message);
|
|
45
|
+
const formResponse = {
|
|
46
|
+
toast: {
|
|
47
|
+
message,
|
|
48
|
+
type: 'error',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
return formResponse;
|
|
52
|
+
}
|
|
53
|
+
default:
|
|
54
|
+
const message = `Unknown actionId: ${actionId}`;
|
|
55
|
+
this.logger.warn(home.name, message);
|
|
56
|
+
const formResponse = {
|
|
57
|
+
toast: {
|
|
58
|
+
type: 'error',
|
|
59
|
+
message,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
return formResponse;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async start() {
|
|
66
|
+
for (const home of this.config.homes) {
|
|
67
|
+
try {
|
|
68
|
+
await this.connectHome(home);
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
this.logger.error(home.name, 'An error occured during connecting to home:', error);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
this.cleanOrphanedCamerasTimeout = setTimeout(() => {
|
|
75
|
+
this.checkOrphanedCameras();
|
|
76
|
+
}, 45 * 1000);
|
|
77
|
+
}
|
|
78
|
+
stop() {
|
|
79
|
+
clearTimeout(this.cleanOrphanedCamerasTimeout);
|
|
80
|
+
this.logger.log('Plugin stopped');
|
|
81
|
+
}
|
|
82
|
+
closeClient(home) {
|
|
83
|
+
const eufyClient = this.eufyClients.get(home.name);
|
|
84
|
+
if (eufyClient) {
|
|
85
|
+
try {
|
|
86
|
+
if (eufyClient.isConnected()) {
|
|
87
|
+
eufyClient.close();
|
|
88
|
+
}
|
|
89
|
+
this.logger.log(home.name, 'Finished shutdown!');
|
|
90
|
+
}
|
|
91
|
+
catch (e) {
|
|
92
|
+
this.logger.error(home.name, `Error while shutdown: ${e}`);
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
this.eufyClients.delete(home.name);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async connectHome(home) {
|
|
100
|
+
let eufyClient;
|
|
101
|
+
try {
|
|
102
|
+
eufyClient = await this.getClient(home);
|
|
103
|
+
this.eufyClients.set(home.name, eufyClient);
|
|
104
|
+
eufyClient.on('device added', this.deviceAdded.bind(this, home, eufyClient));
|
|
105
|
+
eufyClient.on('device removed', this.deviceRemoved.bind(this, home));
|
|
106
|
+
eufyClient.on('push connect', () => {
|
|
107
|
+
this.logger.debug(home.name, 'Push Connected!');
|
|
108
|
+
});
|
|
109
|
+
eufyClient.on('push close', () => {
|
|
110
|
+
this.logger.debug(home.name, 'Push Closed!');
|
|
111
|
+
});
|
|
112
|
+
eufyClient.on('connect', () => {
|
|
113
|
+
this.logger.debug(home.name, 'Connected!');
|
|
114
|
+
});
|
|
115
|
+
eufyClient.on('close', () => {
|
|
116
|
+
this.logger.debug(home.name, 'Closed!');
|
|
117
|
+
});
|
|
118
|
+
eufyClient.on('connection error', async (error) => {
|
|
119
|
+
this.logger.debug(home.name, `Error: ${error}`);
|
|
120
|
+
this.closeClient(home);
|
|
121
|
+
});
|
|
122
|
+
eufyClient.once('captcha request', async () => {
|
|
123
|
+
this.logger.error(home.name, 'CAPTCHA Required! Please re-authenticate via UI and restart Plugin!');
|
|
124
|
+
this.closeClient(home);
|
|
125
|
+
});
|
|
126
|
+
eufyClient.on('tfa request', async () => {
|
|
127
|
+
this.logger.error(home.name, 'Two-Factor Authentication (2FA) Requested! Please re-authenticate via UI and restart Plugin!');
|
|
128
|
+
this.closeClient(home);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
this.logger.error(home.name, 'Error while setup:', error);
|
|
133
|
+
this.logger.error(home.name, 'Not connected cant continue!');
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
if (!eufyClient.isConnected()) {
|
|
138
|
+
await eufyClient.connect();
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
const devices = await eufyClient.getDevices();
|
|
142
|
+
for (const device of devices) {
|
|
143
|
+
await this.deviceAdded(home, eufyClient, device);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
catch (e) {
|
|
148
|
+
this.logger.error(home.name, 'Error authenticating Eufy:', e);
|
|
149
|
+
}
|
|
150
|
+
if (!eufyClient.isConnected()) {
|
|
151
|
+
this.logger.error(home.name, 'Not connected cant continue!');
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
home.maxLiveStreamDuration = home.maxLiveStreamDuration || 86400;
|
|
155
|
+
if (home.maxLiveStreamDuration > 86400) {
|
|
156
|
+
home.maxLiveStreamDuration = 86400;
|
|
157
|
+
this.logger.warn(home.name, 'Your maximum livestream duration value is too large. Since this can cause problems it was reset to 86400 seconds (1 day maximum).');
|
|
158
|
+
}
|
|
159
|
+
else if (home.maxLiveStreamDuration < 10) {
|
|
160
|
+
home.maxLiveStreamDuration = 10;
|
|
161
|
+
this.logger.warn(home.name, 'Your maximum livestream duration value is too small. Since this can cause problems it was reset to 10 seconds (10 seconds minimum).');
|
|
162
|
+
}
|
|
163
|
+
eufyClient.setCameraMaxLivestreamDuration(home.maxLiveStreamDuration);
|
|
164
|
+
this.logger.debug(home.name, `maxLiveStreamDuration: ${eufyClient.getCameraMaxLivestreamDuration()}`);
|
|
165
|
+
}
|
|
166
|
+
async deviceAdded(home, eufyClient, device) {
|
|
167
|
+
try {
|
|
168
|
+
if ((home.ignoreDevices || []).includes(device.getSerial())) {
|
|
169
|
+
this.logger.debug(home.name, `${device.getName()}: Device ignored`);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const deviceContainer = {
|
|
173
|
+
deviceIdentifier: {
|
|
174
|
+
uniqueId: device.getSerial(),
|
|
175
|
+
displayName: 'DEVICE_' + device.getName(),
|
|
176
|
+
type: device.getDeviceType(),
|
|
177
|
+
},
|
|
178
|
+
eufyDevice: device,
|
|
179
|
+
};
|
|
180
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
181
|
+
this.addOrUpdateDevice(home, eufyClient, deviceContainer);
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
this.logger.error(home.name, `Error in deviceAdded: ${error}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
async deviceRemoved(home, device) {
|
|
188
|
+
const serial = device.getSerial();
|
|
189
|
+
this.logger.debug(home.name, `A device has been removed: ${serial}`);
|
|
190
|
+
}
|
|
191
|
+
async addOrUpdateDevice(home, eufyClient, deviceContainer) {
|
|
192
|
+
const isCamera = deviceContainer.eufyDevice instanceof Device ? deviceContainer.eufyDevice.isCamera() : false;
|
|
193
|
+
if (!isCamera) {
|
|
194
|
+
this.logger.debug(home.name, `Device ${deviceContainer.deviceIdentifier.displayName} is not a camera, skipping...`);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const eufyDevice = deviceContainer.eufyDevice;
|
|
198
|
+
const eufyCameraId = eufyDevice.getSerial();
|
|
199
|
+
this.eufyCameras.set(eufyCameraId, eufyDevice);
|
|
200
|
+
const camera = new Camera(this, home, eufyClient, eufyDevice, this.logger);
|
|
201
|
+
await camera.createCameraDevice();
|
|
202
|
+
this.cameras.set(camera.cameraDevice.id, camera.cameraDevice);
|
|
203
|
+
}
|
|
204
|
+
async checkOrphanedCameras() {
|
|
205
|
+
// Remove orphaned cameras
|
|
206
|
+
for (const [cameraId, cameraDevice] of this.cameras) {
|
|
207
|
+
const eufyCameraId = cameraDevice.nativeId;
|
|
208
|
+
if (!this.eufyCameras.get(eufyCameraId)) {
|
|
209
|
+
this.logger.warn('Removing camera', cameraDevice.name);
|
|
210
|
+
this.cameras.delete(cameraId);
|
|
211
|
+
await this.api.deviceManager.removeCameraById(cameraDevice.id);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
tryLogin(home, reAuth) {
|
|
216
|
+
return new Promise(async (_resolve, _reject) => {
|
|
217
|
+
try {
|
|
218
|
+
let connected = false;
|
|
219
|
+
const eufyClient = await this.getClient(home);
|
|
220
|
+
eufyClient.once('connect', () => {
|
|
221
|
+
this.logger.debug(home.name, 'Connected!');
|
|
222
|
+
connected = true;
|
|
223
|
+
_resolve({ connected: true });
|
|
224
|
+
});
|
|
225
|
+
eufyClient.once('close', () => {
|
|
226
|
+
this.logger.debug(home.name, 'Closed!');
|
|
227
|
+
if (!connected) {
|
|
228
|
+
return _reject(new Error('Connection failed'));
|
|
229
|
+
}
|
|
230
|
+
_resolve({ connected: true });
|
|
231
|
+
});
|
|
232
|
+
eufyClient.once('connection error', async (error) => {
|
|
233
|
+
this.logger.debug(home.name, 'Connection Error:', error);
|
|
234
|
+
_reject(error);
|
|
235
|
+
});
|
|
236
|
+
eufyClient.once('captcha request', async (id, captcha) => {
|
|
237
|
+
this.logger.debug(home.name, 'CAPTCHA Required!', id, captcha);
|
|
238
|
+
_resolve({ connected: false, isCaptcha: { id, captcha } });
|
|
239
|
+
});
|
|
240
|
+
eufyClient.once('tfa request', async () => {
|
|
241
|
+
this.logger.debug(home.name, 'Two-Factor Authentication (2FA) Requested!');
|
|
242
|
+
_resolve({ connected: false, is2FA: true });
|
|
243
|
+
});
|
|
244
|
+
const loginOptions = reAuth
|
|
245
|
+
? {
|
|
246
|
+
force: true,
|
|
247
|
+
verifyCode: home.twoFactorCode,
|
|
248
|
+
captcha: home.captchaCode && home.captchaId ? { captchaId: home.captchaId, captchaCode: home.captchaCode } : undefined,
|
|
249
|
+
}
|
|
250
|
+
: undefined;
|
|
251
|
+
if (loginOptions) {
|
|
252
|
+
this.logger.debug(home.name, 'Trying to connect with options:', loginOptions);
|
|
253
|
+
}
|
|
254
|
+
await eufyClient.connect(loginOptions);
|
|
255
|
+
}
|
|
256
|
+
catch (error) {
|
|
257
|
+
_reject(error);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
async getClient(home) {
|
|
262
|
+
let eufyClient = this.eufyClients.get(home.name);
|
|
263
|
+
if (!eufyClient) {
|
|
264
|
+
const logger = {
|
|
265
|
+
info: (message, ...args) => {
|
|
266
|
+
this.logger.log(home.name, message, ...args);
|
|
267
|
+
},
|
|
268
|
+
warn: (message, ...args) => {
|
|
269
|
+
this.logger.warn(home.name, message, ...args);
|
|
270
|
+
},
|
|
271
|
+
error: (message, ...args) => {
|
|
272
|
+
this.logger.error(home.name, message, ...args);
|
|
273
|
+
},
|
|
274
|
+
fatal: (message, ...args) => {
|
|
275
|
+
this.logger.error(home.name, message, ...args);
|
|
276
|
+
},
|
|
277
|
+
debug: (message, ...args) => {
|
|
278
|
+
if (home.debug) {
|
|
279
|
+
this.logger.debug(home.name, message, ...args);
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
trace: (message, ...args) => {
|
|
283
|
+
if (home.debug) {
|
|
284
|
+
this.logger.debug(home.name, message, ...args);
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
const eufyConfig = {
|
|
289
|
+
username: home.username,
|
|
290
|
+
password: home.password,
|
|
291
|
+
country: getCountryCode(home.country),
|
|
292
|
+
trustedDeviceName: home.deviceName,
|
|
293
|
+
language: 'en',
|
|
294
|
+
p2pConnectionSetup: P2PConnectionType.QUICKEST,
|
|
295
|
+
pollingIntervalMinutes: 10,
|
|
296
|
+
eventDurationSeconds: 10,
|
|
297
|
+
};
|
|
298
|
+
eufyClient = await EufySecurity.initialize(eufyConfig, logger);
|
|
299
|
+
this.eufyClients.set(home.name, eufyClient);
|
|
300
|
+
}
|
|
301
|
+
return eufyClient;
|
|
302
|
+
}
|
|
303
|
+
createFormResponse(connectionResponse) {
|
|
304
|
+
const formResponse = {
|
|
305
|
+
toast: {
|
|
306
|
+
type: 'success',
|
|
307
|
+
message: 'Logged in!',
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
if (connectionResponse.is2FA) {
|
|
311
|
+
formResponse.schema = {
|
|
312
|
+
config: {
|
|
313
|
+
type: 'object',
|
|
314
|
+
title: 'Two-Factor Authentication (2FA)',
|
|
315
|
+
description: 'Enter the 2FA code',
|
|
316
|
+
required: true,
|
|
317
|
+
opened: true,
|
|
318
|
+
properties: {
|
|
319
|
+
twoFactorCode: {
|
|
320
|
+
type: 'string',
|
|
321
|
+
key: 'twoFactorCode',
|
|
322
|
+
title: 'Two-Factor Code',
|
|
323
|
+
description: 'Enter the two-factor code',
|
|
324
|
+
required: true,
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
buttons: [
|
|
328
|
+
{
|
|
329
|
+
label: 'Authenticate',
|
|
330
|
+
onSubmit: 'on2FA',
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
},
|
|
334
|
+
};
|
|
335
|
+
formResponse.toast = {
|
|
336
|
+
message: 'Two-Factor Authentication (2FA) Required!',
|
|
337
|
+
type: 'warning',
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
else if (connectionResponse.isCaptcha) {
|
|
341
|
+
formResponse.schema = {
|
|
342
|
+
config: {
|
|
343
|
+
type: 'object',
|
|
344
|
+
title: 'Two-Factor Authentication (2FA)',
|
|
345
|
+
description: 'Enter the 2FA code',
|
|
346
|
+
required: true,
|
|
347
|
+
opened: true,
|
|
348
|
+
properties: {
|
|
349
|
+
captcha: {
|
|
350
|
+
type: 'string',
|
|
351
|
+
key: 'captcha',
|
|
352
|
+
title: 'Captcha',
|
|
353
|
+
description: 'Enter the captcha',
|
|
354
|
+
format: 'image',
|
|
355
|
+
defaultValue: connectionResponse.isCaptcha.captcha,
|
|
356
|
+
},
|
|
357
|
+
captchaCode: {
|
|
358
|
+
type: 'string',
|
|
359
|
+
key: 'captchaCode',
|
|
360
|
+
title: 'Captcha Code',
|
|
361
|
+
description: 'Enter the captcha code',
|
|
362
|
+
required: true,
|
|
363
|
+
},
|
|
364
|
+
captchaId: {
|
|
365
|
+
type: 'string',
|
|
366
|
+
key: 'captchaId',
|
|
367
|
+
hidden: true,
|
|
368
|
+
defaultValue: connectionResponse.isCaptcha.id,
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
buttons: [
|
|
372
|
+
{
|
|
373
|
+
label: 'Authenticate',
|
|
374
|
+
onSubmit: 'onCaptcha',
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
},
|
|
378
|
+
};
|
|
379
|
+
formResponse.toast = {
|
|
380
|
+
message: 'CAPTCHA Required!',
|
|
381
|
+
type: 'warning',
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
return formResponse;
|
|
385
|
+
}
|
|
386
|
+
refreshConfig(home) {
|
|
387
|
+
if ('twoFactorCode' in home) {
|
|
388
|
+
delete home.twoFactorCode;
|
|
389
|
+
}
|
|
390
|
+
if ('captcha' in home) {
|
|
391
|
+
delete home.captcha;
|
|
392
|
+
}
|
|
393
|
+
if ('captchaCode' in home) {
|
|
394
|
+
delete home.captchaCode;
|
|
395
|
+
}
|
|
396
|
+
if ('captchaId' in home) {
|
|
397
|
+
delete home.captchaId;
|
|
398
|
+
}
|
|
399
|
+
this.api.configService.replaceOrAddItem('homes', 'name', home.name, home, true);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAM5C,MAAM,CAAC,OAAO,OAAO,IAAI;IAChB,MAAM,CAAS;IACf,MAAM,CAAe;IACrB,GAAG,CAAY;IACf,OAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;IAEzC,WAAW,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC9C,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IAExC,2BAA2B,CAAkB;IAErD,YAAY,MAAoB,EAAE,GAAc;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QAEf,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,aAAa,CAAC,GAAG,EAAY,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QAE1G,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC,KA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YAAY,CAAC,KAAK,GAAG;gBACnB,OAAO,EAAE,mBAAmB;gBAC5B,IAAI,EAAE,SAAS;aAChB,CAAC;QACJ,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;IAEO,aAAa,CAAC,IAAc;QAClC,IAAI,eAAe,IAAI,IAAI,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC;QAED,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QAED,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;QAED,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAClF,CAAC;CACF"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Device, Station } from 'eufy-security-client';
|
|
2
|
+
export interface DeviceIdentifier {
|
|
3
|
+
uniqueId: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
type: number;
|
|
6
|
+
}
|
|
7
|
+
export interface StationContainer {
|
|
8
|
+
deviceIdentifier: DeviceIdentifier;
|
|
9
|
+
eufyDevice: Station;
|
|
10
|
+
}
|
|
11
|
+
export interface DeviceContainer {
|
|
12
|
+
deviceIdentifier: DeviceIdentifier;
|
|
13
|
+
eufyDevice: Device;
|
|
14
|
+
}
|
|
15
|
+
export interface EufyHome {
|
|
16
|
+
name: string;
|
|
17
|
+
username: string;
|
|
18
|
+
password: string;
|
|
19
|
+
country?: string;
|
|
20
|
+
deviceName?: string;
|
|
21
|
+
debug?: boolean;
|
|
22
|
+
maxLiveStreamDuration?: number;
|
|
23
|
+
ignoreDevices?: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface Config {
|
|
26
|
+
homes: EufyHome[];
|
|
27
|
+
}
|
|
28
|
+
export interface EufyConnectionResponse {
|
|
29
|
+
connected: boolean;
|
|
30
|
+
is2FA?: boolean;
|
|
31
|
+
isCaptcha?: {
|
|
32
|
+
id: string;
|
|
33
|
+
captcha: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export type FormAction = 'onLogin' | 'on2FA' | 'onCaptcha';
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/dist/utils.d.ts
ADDED