homebridge-eufy-security 2.2.0-beta.1 → 2.2.0-beta.4

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 (68) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/dist/accessories/CameraAccessory.d.ts.map +1 -1
  3. package/dist/accessories/CameraAccessory.js +37 -13
  4. package/dist/accessories/CameraAccessory.js.map +1 -1
  5. package/dist/accessories/Device.d.ts.map +1 -1
  6. package/dist/accessories/Device.js +15 -0
  7. package/dist/accessories/Device.js.map +1 -1
  8. package/dist/accessories/DoorbellCameraAccessory.d.ts.map +1 -1
  9. package/dist/accessories/DoorbellCameraAccessory.js +0 -6
  10. package/dist/accessories/DoorbellCameraAccessory.js.map +1 -1
  11. package/dist/config.d.ts +2 -0
  12. package/dist/config.d.ts.map +1 -1
  13. package/dist/controller/SnapshotManager.d.ts +2 -1
  14. package/dist/controller/SnapshotManager.d.ts.map +1 -1
  15. package/dist/controller/SnapshotManager.js +29 -7
  16. package/dist/controller/SnapshotManager.js.map +1 -1
  17. package/dist/controller/streamingDelegate.d.ts.map +1 -1
  18. package/dist/controller/streamingDelegate.js +1 -0
  19. package/dist/controller/streamingDelegate.js.map +1 -1
  20. package/dist/platform.d.ts +4 -2
  21. package/dist/platform.d.ts.map +1 -1
  22. package/dist/platform.js +19 -2
  23. package/dist/platform.js.map +1 -1
  24. package/dist/utils/EufyClientInteractor.d.ts +34 -0
  25. package/dist/utils/EufyClientInteractor.d.ts.map +1 -0
  26. package/dist/utils/EufyClientInteractor.js +310 -0
  27. package/dist/utils/EufyClientInteractor.js.map +1 -0
  28. package/dist/utils/Talkback.d.ts +2 -0
  29. package/dist/utils/Talkback.d.ts.map +1 -1
  30. package/dist/utils/Talkback.js +11 -2
  31. package/dist/utils/Talkback.js.map +1 -1
  32. package/dist/utils/configTypes.d.ts +5 -0
  33. package/dist/utils/configTypes.d.ts.map +1 -1
  34. package/dist/utils/experimental.d.ts +4 -0
  35. package/dist/utils/experimental.d.ts.map +1 -0
  36. package/dist/utils/experimental.js +49 -0
  37. package/dist/utils/experimental.js.map +1 -0
  38. package/dist/utils/ffmpeg.d.ts +3 -0
  39. package/dist/utils/ffmpeg.d.ts.map +1 -1
  40. package/dist/utils/ffmpeg.js +63 -19
  41. package/dist/utils/ffmpeg.js.map +1 -1
  42. package/dist/utils/interfaces.d.ts +12 -0
  43. package/dist/utils/interfaces.d.ts.map +1 -0
  44. package/dist/utils/interfaces.js +12 -0
  45. package/dist/utils/interfaces.js.map +1 -0
  46. package/homebridge-ui/plugin/utils/EufyClientInteractor.d.ts +34 -0
  47. package/homebridge-ui/plugin/utils/EufyClientInteractor.d.ts.map +1 -0
  48. package/homebridge-ui/plugin/utils/EufyClientInteractor.js +310 -0
  49. package/homebridge-ui/plugin/utils/EufyClientInteractor.js.map +1 -0
  50. package/homebridge-ui/plugin/utils/experimental.d.ts +4 -0
  51. package/homebridge-ui/plugin/utils/experimental.d.ts.map +1 -0
  52. package/homebridge-ui/plugin/utils/experimental.js +49 -0
  53. package/homebridge-ui/plugin/utils/experimental.js.map +1 -0
  54. package/homebridge-ui/plugin/utils/interfaces.d.ts +12 -0
  55. package/homebridge-ui/plugin/utils/interfaces.d.ts.map +1 -0
  56. package/homebridge-ui/plugin/utils/interfaces.js +12 -0
  57. package/homebridge-ui/plugin/utils/interfaces.js.map +1 -0
  58. package/homebridge-ui/plugin/utils/logger.d.ts +12 -0
  59. package/homebridge-ui/plugin/utils/logger.d.ts.map +1 -0
  60. package/homebridge-ui/plugin/utils/logger.js +36 -0
  61. package/homebridge-ui/plugin/utils/logger.js.map +1 -0
  62. package/homebridge-ui/public/3rdpartylicenses.txt +169 -0
  63. package/homebridge-ui/public/index.html +1 -1
  64. package/homebridge-ui/public/main.cf8346cc1457cd72.js +1 -0
  65. package/homebridge-ui/server.js +14 -1
  66. package/homebridge-ui/server.js.map +1 -1
  67. package/package.json +2 -2
  68. package/homebridge-ui/public/main.1271ca7a8e752b32.js +0 -1
@@ -0,0 +1,310 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EufyClientInteractor = void 0;
7
+ const events_1 = __importDefault(require("events"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const net_1 = __importDefault(require("net"));
10
+ const eufy_security_client_1 = require("eufy-security-client");
11
+ const pick_port_1 = __importDefault(require("pick-port"));
12
+ const interfaces_1 = require("./interfaces");
13
+ const experimental_1 = require("./experimental");
14
+ var InteractorRequestType;
15
+ (function (InteractorRequestType) {
16
+ InteractorRequestType["DeviceChargingStatus"] = "deviceChargingStatus";
17
+ InteractorRequestType["DeviceChangeExperimentalRTSPStatus"] = "deviceExperimentalRtspStatusChange";
18
+ InteractorRequestType["DeviceGetExperimentalRTSPStatus"] = "deviceExperimentalRtspStatusGet";
19
+ })(InteractorRequestType || (InteractorRequestType = {}));
20
+ class EufyClientInteractor extends events_1.default {
21
+ constructor(path, log, client) {
22
+ super();
23
+ this.log = log;
24
+ this.storagePath = path;
25
+ this.client = client;
26
+ }
27
+ setClient(client) {
28
+ this.client = client;
29
+ }
30
+ async setupServer() {
31
+ const port = await this.getFreePort();
32
+ if (!this.writePortToStoragePath(port)) {
33
+ return Promise.reject(new Error('Could not start interaction server'));
34
+ }
35
+ return new Promise((resolve, reject) => {
36
+ this.server = net_1.default.createServer((socket) => {
37
+ socket.on('data', (data) => {
38
+ const request = JSON.parse(data.toString('utf-8'));
39
+ this.log.debug(`incoming Interaction Request: for ${request.serialNumber}, type: ${request.type}`);
40
+ this.processIPCRequest(socket, request);
41
+ });
42
+ socket.on('error', this.onSocketError.bind(this));
43
+ });
44
+ this.server.on('error', this.onServerError.bind(this));
45
+ this.server.listen(port, () => {
46
+ this.log.debug(`Plugin-Config interaction server was started on port: ${port}`);
47
+ resolve();
48
+ });
49
+ });
50
+ }
51
+ stopServer() {
52
+ if (this.server) {
53
+ this.server.close();
54
+ }
55
+ }
56
+ async getFreePort() {
57
+ return await (0, pick_port_1.default)({
58
+ type: 'tcp',
59
+ ip: '0.0.0.0',
60
+ reserveTimeout: 15,
61
+ });
62
+ }
63
+ writePortToStoragePath(port) {
64
+ try {
65
+ fs_1.default.writeFileSync(this.storagePath + '/interaction.port', `${port}`, { encoding: 'utf-8' });
66
+ return true;
67
+ }
68
+ catch (err) {
69
+ return false;
70
+ }
71
+ }
72
+ loadPort() {
73
+ try {
74
+ const port = fs_1.default.readFileSync(this.storagePath + '/interaction.port', { encoding: 'utf-8' });
75
+ return parseInt(port);
76
+ }
77
+ catch (err) {
78
+ return -1;
79
+ }
80
+ }
81
+ ipcRequest(request) {
82
+ this.log.debug(`Interaction Request: for ${request.serialNumber}, type: ${request.type}`);
83
+ return new Promise((resolve, reject) => {
84
+ const port = this.loadPort();
85
+ if (port <= 0) {
86
+ reject('Could not read port for interaction server');
87
+ }
88
+ const socket = net_1.default.createConnection(port, 'localhost', () => {
89
+ socket.write(JSON.stringify(request));
90
+ });
91
+ const timeout = setTimeout(() => {
92
+ socket.destroy();
93
+ reject('no answer was retrieved from server');
94
+ }, 10000);
95
+ socket.on('error', (err) => {
96
+ reject(err);
97
+ socket.destroy();
98
+ });
99
+ socket.on('data', (data) => {
100
+ const response = JSON.parse(data.toString('utf-8'));
101
+ if (response.serialNumber !== request.serialNumber || response.type !== request.type) {
102
+ reject(new Error('invalid ipc response'));
103
+ }
104
+ else {
105
+ resolve(response);
106
+ }
107
+ clearTimeout(timeout);
108
+ socket.destroy();
109
+ });
110
+ });
111
+ }
112
+ async processIPCRequest(socket, request) {
113
+ if (!this.client) {
114
+ const response = {
115
+ serialNumber: request.serialNumber,
116
+ type: request.type,
117
+ error: new interfaces_1.EufyClientNotRunningError('eufy client not running'),
118
+ };
119
+ socket.write(JSON.stringify(response));
120
+ return;
121
+ }
122
+ let response = {
123
+ serialNumber: request.serialNumber,
124
+ type: request.type,
125
+ };
126
+ try {
127
+ response = await this.processDirectRequest(request);
128
+ }
129
+ catch (err) {
130
+ response.error = err;
131
+ }
132
+ // eslint-disable-next-line max-len
133
+ this.log.debug(`outgoing Interaction Response: for ${response.serialNumber}, type: ${response.type}, result: ${response.result}, error: ${response.error}`);
134
+ socket.write(JSON.stringify(response));
135
+ }
136
+ async processDirectRequest(request) {
137
+ if (!this.client) {
138
+ // forward to interaction server
139
+ return this.ipcRequest(request);
140
+ }
141
+ const response = {
142
+ serialNumber: request.serialNumber,
143
+ type: request.type,
144
+ };
145
+ try {
146
+ switch (request.type) {
147
+ case InteractorRequestType.DeviceChargingStatus:
148
+ response.result = await this.getChargingStatus(request);
149
+ break;
150
+ case InteractorRequestType.DeviceChangeExperimentalRTSPStatus:
151
+ response.result = await this.getExperimentalRTSPStatusChangeResult(request);
152
+ break;
153
+ case InteractorRequestType.DeviceGetExperimentalRTSPStatus:
154
+ response.result = await this.getExperimentalRTSPState(request);
155
+ break;
156
+ default:
157
+ response.error = new Error('Request type not implemented.');
158
+ break;
159
+ }
160
+ }
161
+ catch (err) {
162
+ response.error = err;
163
+ }
164
+ // eslint-disable-next-line max-len
165
+ this.log.debug(`Interaction Response: for ${response.serialNumber}, type: ${response.type}, result: ${response.result}, error: ${response.error}`);
166
+ return Promise.resolve(response);
167
+ }
168
+ async getChargingStatus(request) {
169
+ const device = await this.client.getDevice(request.serialNumber);
170
+ return new Promise((resolve, reject) => {
171
+ if (!device.hasBattery()) {
172
+ // device has no battery, so it is always powered with plug
173
+ resolve(3);
174
+ }
175
+ else if (device.hasProperty(eufy_security_client_1.PropertyName.DeviceChargingStatus)) {
176
+ resolve(device.getPropertyValue(eufy_security_client_1.PropertyName.DeviceChargingStatus));
177
+ }
178
+ else {
179
+ reject(new Error('battery charging property could not be retrieved'));
180
+ }
181
+ });
182
+ }
183
+ async getExperimentalRTSPStatusChangeResult(request) {
184
+ (0, experimental_1.initializeExperimentalMode)();
185
+ const device = await this.client.getDevice(request.serialNumber);
186
+ const station = this.client.getStation(device.getStationSerial());
187
+ return new Promise((resolve, reject) => {
188
+ if (request.value === undefined) {
189
+ reject(new Error('no value was given'));
190
+ }
191
+ else if (!device.hasProperty(eufy_security_client_1.PropertyName.DeviceRTSPStream) &&
192
+ !device.hasProperty(eufy_security_client_1.PropertyName['ExperimentalModification'])) {
193
+ reject(new Error('device has no experimental rtsp setting'));
194
+ }
195
+ else {
196
+ let to = undefined;
197
+ const propertyListener = (d, name, value) => {
198
+ if (request.value) {
199
+ if (device.getSerial() === d.getSerial() && name === eufy_security_client_1.PropertyName.DeviceRTSPStreamUrl && value) {
200
+ if (to) {
201
+ clearTimeout(to);
202
+ }
203
+ device.removeListener('property changed', propertyListener);
204
+ resolve(value);
205
+ }
206
+ }
207
+ else {
208
+ if (device.getSerial() === d.getSerial() && name === eufy_security_client_1.PropertyName.DeviceRTSPStream && value === false) {
209
+ if (to) {
210
+ clearTimeout(to);
211
+ }
212
+ device.removeListener('property changed', propertyListener);
213
+ resolve('');
214
+ }
215
+ }
216
+ };
217
+ to = setTimeout(() => {
218
+ device.removeListener('property changed', propertyListener);
219
+ reject(new Error('setting rtsp feature timed out'));
220
+ }, 15000);
221
+ device.on('property changed', propertyListener);
222
+ station.setRTSPStream(device, request.value);
223
+ }
224
+ });
225
+ }
226
+ async getExperimentalRTSPState(request) {
227
+ (0, experimental_1.initializeExperimentalMode)();
228
+ try {
229
+ const device = await this.client.getDevice(request.serialNumber);
230
+ let state = device.getPropertyValue(eufy_security_client_1.PropertyName.DeviceRTSPStream);
231
+ const url = device.getPropertyValue(eufy_security_client_1.PropertyName.DeviceRTSPStreamUrl);
232
+ if (url && url !== '') {
233
+ state = true;
234
+ }
235
+ return Promise.resolve({
236
+ state: state,
237
+ url: url,
238
+ });
239
+ }
240
+ catch (err) {
241
+ return Promise.reject(err);
242
+ }
243
+ }
244
+ onSocketError(err) {
245
+ this.log.error(`There was an error on the PluginConfigInteractor socket: ${err}`);
246
+ }
247
+ onServerError(err) {
248
+ this.log.error(`There was an error on the PluginConfigInteractor server: ${err}`);
249
+ }
250
+ async DeviceIsCharging(sn) {
251
+ const request = {
252
+ serialNumber: sn,
253
+ type: InteractorRequestType.DeviceChargingStatus,
254
+ };
255
+ try {
256
+ const response = await this.processDirectRequest(request);
257
+ if (response.error) {
258
+ return Promise.reject(response.error.message);
259
+ }
260
+ if (response.result === undefined) {
261
+ return Promise.reject('there was no result');
262
+ }
263
+ return Promise.resolve(response.result);
264
+ }
265
+ catch (err) {
266
+ return Promise.reject(err);
267
+ }
268
+ }
269
+ async DeviceSetExperimentalRTSP(sn, value) {
270
+ const request = {
271
+ serialNumber: sn,
272
+ type: InteractorRequestType.DeviceChangeExperimentalRTSPStatus,
273
+ value: value,
274
+ };
275
+ try {
276
+ const response = await this.processDirectRequest(request);
277
+ if (response.error) {
278
+ return Promise.reject(response.error.message);
279
+ }
280
+ if (response.result === undefined) {
281
+ return Promise.reject('there was no result');
282
+ }
283
+ return Promise.resolve(response.result);
284
+ }
285
+ catch (err) {
286
+ return Promise.reject(err);
287
+ }
288
+ }
289
+ async DeviceGetExperimentalRTSPStatus(sn) {
290
+ const request = {
291
+ serialNumber: sn,
292
+ type: InteractorRequestType.DeviceGetExperimentalRTSPStatus,
293
+ };
294
+ try {
295
+ const response = await this.processDirectRequest(request);
296
+ if (response.error) {
297
+ return Promise.reject(response.error.message);
298
+ }
299
+ if (response.result === undefined) {
300
+ return Promise.reject('there was no result');
301
+ }
302
+ return Promise.resolve(response.result);
303
+ }
304
+ catch (err) {
305
+ return Promise.reject(err);
306
+ }
307
+ }
308
+ }
309
+ exports.EufyClientInteractor = EufyClientInteractor;
310
+ //# sourceMappingURL=EufyClientInteractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EufyClientInteractor.js","sourceRoot":"","sources":["../../../src/plugin/utils/EufyClientInteractor.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAkC;AAClC,4CAAoB;AACpB,8CAAsB;AAEtB,+DA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OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,MAA0C,CAAC,CAAC;SAC7E;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SAC5B;IACH,CAAC;CACF;AAvUD,oDAuUC"}
@@ -0,0 +1,4 @@
1
+ import { Station, Device } from 'eufy-security-client';
2
+ export declare const initializeExperimentalMode: () => void;
3
+ export declare const setRTSPCapability: (station: Station, device: Device, value: boolean) => void;
4
+ //# sourceMappingURL=experimental.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../../../src/plugin/utils/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,OAAO,EACP,MAAM,EACP,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,0BAA0B,YAEtC,CAAC;AA6CF,eAAO,MAAM,iBAAiB,YAAa,OAAO,UAAU,MAAM,SAAS,OAAO,SAEjF,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setRTSPCapability = exports.initializeExperimentalMode = void 0;
4
+ const eufy_security_client_1 = require("eufy-security-client");
5
+ const initializeExperimentalMode = () => {
6
+ addRTSPPropertiesToAllDevices();
7
+ };
8
+ exports.initializeExperimentalMode = initializeExperimentalMode;
9
+ eufy_security_client_1.PropertyName['ExperimentalModification'] = 'experimentalModification';
10
+ const DeviceExperimentalModification = {
11
+ key: 0,
12
+ name: eufy_security_client_1.PropertyName['ExperimentalModification'],
13
+ label: 'Experimental Modification',
14
+ readable: true,
15
+ writeable: false,
16
+ type: 'boolean',
17
+ };
18
+ const addRTSPPropertiesToAllDevices = () => {
19
+ const deviceTypes = Object.values(eufy_security_client_1.DeviceType).filter(t => !isNaN(Number(t)));
20
+ deviceTypes.forEach(deviceType => addRTSPPropertiesToDevice(deviceType));
21
+ };
22
+ const addRTSPPropertiesToDevice = (deviceType) => {
23
+ let changed = false;
24
+ if (eufy_security_client_1.DeviceProperties[deviceType] && !eufy_security_client_1.DeviceProperties[deviceType][eufy_security_client_1.PropertyName.DeviceRTSPStream]) {
25
+ eufy_security_client_1.DeviceProperties[deviceType] = {
26
+ ...eufy_security_client_1.DeviceProperties[deviceType],
27
+ [eufy_security_client_1.PropertyName.DeviceRTSPStream]: eufy_security_client_1.DeviceRTSPStreamProperty,
28
+ };
29
+ changed = true;
30
+ }
31
+ if (eufy_security_client_1.DeviceProperties[deviceType] && !eufy_security_client_1.DeviceProperties[deviceType][eufy_security_client_1.PropertyName.DeviceRTSPStreamUrl]) {
32
+ eufy_security_client_1.DeviceProperties[deviceType] = {
33
+ ...eufy_security_client_1.DeviceProperties[deviceType],
34
+ [eufy_security_client_1.PropertyName.DeviceRTSPStreamUrl]: eufy_security_client_1.DeviceRTSPStreamUrlProperty,
35
+ };
36
+ changed = true;
37
+ }
38
+ if (changed && eufy_security_client_1.DeviceProperties[deviceType] && !eufy_security_client_1.DeviceProperties[deviceType][eufy_security_client_1.PropertyName['ExperimentalModification']]) {
39
+ eufy_security_client_1.DeviceProperties[deviceType] = {
40
+ ...eufy_security_client_1.DeviceProperties[deviceType],
41
+ [eufy_security_client_1.PropertyName['ExperimentalModification']]: DeviceExperimentalModification,
42
+ };
43
+ }
44
+ };
45
+ const setRTSPCapability = (station, device, value) => {
46
+ station.setRTSPStream(device, value);
47
+ };
48
+ exports.setRTSPCapability = setRTSPCapability;
49
+ //# sourceMappingURL=experimental.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experimental.js","sourceRoot":"","sources":["../../../src/plugin/utils/experimental.ts"],"names":[],"mappings":";;;AAAA,+DAS8B;AAEvB,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,6BAA6B,EAAE,CAAC;AAClC,CAAC,CAAC;AAFW,QAAA,0BAA0B,8BAErC;AAEF,mCAAY,CAAC,0BAA0B,CAAC,GAAG,0BAA0B,CAAC;AAEtE,MAAM,8BAA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U,CAAC,IAAI,CAAC,uCAAgB,CAAC,UAAU,CAAC,CAAC,mCAAY,CAAC,0BAA0B,CAAC,CAAC,EAAE;QACtH,uCAAgB,CAAC,UAAU,CAAC,GAAG;YAC7B,GAAG,uCAAgB,CAAC,UAAU,CAAC;YAC/B,CAAC,mCAAY,CAAC,0BAA0B,CAAC,CAAC,EAAE,8BAA8B;SAC3E,CAAC;KACH;AACH,CAAC,CAAC;AAEK,MAAM,iBAAiB,GAAG,CAAC,OAAgB,EAAE,MAAc,EAAE,KAAc,EAAE,EAAE;IACpF,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACvC,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B"}
@@ -0,0 +1,12 @@
1
+ export declare class EufyClientNotRunningError extends Error {
2
+ constructor(message?: string);
3
+ }
4
+ export interface PluginConfigInteractor {
5
+ DeviceIsCharging(sn: string): Promise<number>;
6
+ DeviceSetExperimentalRTSP(sn: string, value: boolean): Promise<string>;
7
+ DeviceGetExperimentalRTSPStatus(sn: string): Promise<{
8
+ state: boolean;
9
+ url?: string;
10
+ }>;
11
+ }
12
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/plugin/utils/interfaces.ts"],"names":[],"mappings":"AAAA,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,OAAO,CAAC,EAAE,MAAM;CAK7B;AAED,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,yBAAyB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACvE,+BAA+B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxF"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EufyClientNotRunningError = void 0;
4
+ class EufyClientNotRunningError extends Error {
5
+ constructor(message) {
6
+ super(message);
7
+ Object.setPrototypeOf(this, new.target.prototype);
8
+ this.name = EufyClientNotRunningError.name;
9
+ }
10
+ }
11
+ exports.EufyClientNotRunningError = EufyClientNotRunningError;
12
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/plugin/utils/interfaces.ts"],"names":[],"mappings":";;;AAAA,MAAa,yBAA0B,SAAQ,KAAK;IAClD,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC,IAAI,CAAC;IAC7C,CAAC;CACF;AAND,8DAMC"}
@@ -0,0 +1,12 @@
1
+ import { Logging } from 'homebridge';
2
+ export declare class Logger {
3
+ private readonly log;
4
+ private readonly debugMode;
5
+ constructor(log: Logging);
6
+ private formatMessage;
7
+ info(message: string, device?: string): void;
8
+ warn(message: string, device?: string): void;
9
+ error(message: string, device?: string): void;
10
+ debug(message: string, device?: string, alwaysLog?: boolean): void;
11
+ }
12
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/plugin/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;gBAExB,GAAG,EAAE,OAAO;IAKxB,OAAO,CAAC,aAAa;IASd,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAI5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAI5C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAI7C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,IAAI;CAOxE"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Logger = void 0;
4
+ class Logger {
5
+ constructor(log) {
6
+ this.log = log;
7
+ this.debugMode = process.argv.includes('-D') || process.argv.includes('--debug');
8
+ }
9
+ formatMessage(message, device) {
10
+ let formatted = '';
11
+ if (device) {
12
+ formatted += '[' + device + '] ';
13
+ }
14
+ formatted += message;
15
+ return formatted;
16
+ }
17
+ info(message, device) {
18
+ this.log.info(this.formatMessage(message, device));
19
+ }
20
+ warn(message, device) {
21
+ this.log.warn(this.formatMessage(message, device));
22
+ }
23
+ error(message, device) {
24
+ this.log.error(this.formatMessage(message, device));
25
+ }
26
+ debug(message, device, alwaysLog = false) {
27
+ if (this.debugMode) {
28
+ this.log.debug(this.formatMessage(message, device));
29
+ }
30
+ else if (alwaysLog) {
31
+ this.info(message, device);
32
+ }
33
+ }
34
+ }
35
+ exports.Logger = Logger;
36
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/plugin/utils/logger.ts"],"names":[],"mappings":";;;AAEA,MAAa,MAAM;IAIjB,YAAY,GAAY;QACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACnF,CAAC;IAEO,aAAa,CAAC,OAAe,EAAE,MAAe;QACpD,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,IAAI,MAAM,EAAE;YACV,SAAS,IAAI,GAAG,GAAG,MAAM,GAAG,IAAI,CAAC;SAClC;QACD,SAAS,IAAI,OAAO,CAAC;QACrB,OAAO,SAAS,CAAC;IACnB,CAAC;IAEM,IAAI,CAAC,OAAe,EAAE,MAAe;QAC1C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC;IAEM,IAAI,CAAC,OAAe,EAAE,MAAe;QAC1C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,OAAe,EAAE,MAAe;QAC3C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,CAAC;IAEM,KAAK,CAAC,OAAe,EAAE,MAAe,EAAE,SAAS,GAAG,KAAK;QAC9D,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;SACrD;aAAM,IAAI,SAAS,EAAE;YACpB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAC5B;IACH,CAAC;CACF;AArCD,wBAqCC"}
@@ -210,6 +210,175 @@ Awesome, nor vice versa. **Please do not use brand logos for any purpose except
210
210
  to represent the company, product, or service to which they refer.**
211
211
 
212
212
 
213
+ @fortawesome/free-regular-svg-icons
214
+ (CC-BY-4.0 AND MIT)
215
+ Fonticons, Inc. (https://fontawesome.com)
216
+
217
+ --------------------------------------------------------------------------------
218
+
219
+ Font Awesome Free License
220
+
221
+ Font Awesome Free is free, open source, and GPL friendly. You can use it for
222
+ commercial projects, open source projects, or really almost whatever you want.
223
+ Full Font Awesome Free license: https://fontawesome.com/license/free.
224
+
225
+ --------------------------------------------------------------------------------
226
+
227
+ # Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
228
+
229
+ The Font Awesome Free download is licensed under a Creative Commons
230
+ Attribution 4.0 International License and applies to all icons packaged
231
+ as SVG and JS file types.
232
+
233
+ --------------------------------------------------------------------------------
234
+
235
+ # Fonts: SIL OFL 1.1 License
236
+
237
+ In the Font Awesome Free download, the SIL OFL license applies to all icons
238
+ packaged as web and desktop font files.
239
+
240
+ Copyright (c) 2022 Fonticons, Inc. (https://fontawesome.com)
241
+ with Reserved Font Name: "Font Awesome".
242
+
243
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
244
+ This license is copied below, and is also available with a FAQ at:
245
+ http://scripts.sil.org/OFL
246
+
247
+ SIL OPEN FONT LICENSE
248
+ Version 1.1 - 26 February 2007
249
+
250
+ PREAMBLE
251
+ The goals of the Open Font License (OFL) are to stimulate worldwide
252
+ development of collaborative font projects, to support the font creation
253
+ efforts of academic and linguistic communities, and to provide a free and
254
+ open framework in which fonts may be shared and improved in partnership
255
+ with others.
256
+
257
+ The OFL allows the licensed fonts to be used, studied, modified and
258
+ redistributed freely as long as they are not sold by themselves. The
259
+ fonts, including any derivative works, can be bundled, embedded,
260
+ redistributed and/or sold with any software provided that any reserved
261
+ names are not used by derivative works. The fonts and derivatives,
262
+ however, cannot be released under any other type of license. The
263
+ requirement for fonts to remain under this license does not apply
264
+ to any document created using the fonts or their derivatives.
265
+
266
+ DEFINITIONS
267
+ "Font Software" refers to the set of files released by the Copyright
268
+ Holder(s) under this license and clearly marked as such. This may
269
+ include source files, build scripts and documentation.
270
+
271
+ "Reserved Font Name" refers to any names specified as such after the
272
+ copyright statement(s).
273
+
274
+ "Original Version" refers to the collection of Font Software components as
275
+ distributed by the Copyright Holder(s).
276
+
277
+ "Modified Version" refers to any derivative made by adding to, deleting,
278
+ or substituting — in part or in whole — any of the components of the
279
+ Original Version, by changing formats or by porting the Font Software to a
280
+ new environment.
281
+
282
+ "Author" refers to any designer, engineer, programmer, technical
283
+ writer or other person who contributed to the Font Software.
284
+
285
+ PERMISSION & CONDITIONS
286
+ Permission is hereby granted, free of charge, to any person obtaining
287
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
288
+ redistribute, and sell modified and unmodified copies of the Font
289
+ Software, subject to the following conditions:
290
+
291
+ 1) Neither the Font Software nor any of its individual components,
292
+ in Original or Modified Versions, may be sold by itself.
293
+
294
+ 2) Original or Modified Versions of the Font Software may be bundled,
295
+ redistributed and/or sold with any software, provided that each copy
296
+ contains the above copyright notice and this license. These can be
297
+ included either as stand-alone text files, human-readable headers or
298
+ in the appropriate machine-readable metadata fields within text or
299
+ binary files as long as those fields can be easily viewed by the user.
300
+
301
+ 3) No Modified Version of the Font Software may use the Reserved Font
302
+ Name(s) unless explicit written permission is granted by the corresponding
303
+ Copyright Holder. This restriction only applies to the primary font name as
304
+ presented to the users.
305
+
306
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
307
+ Software shall not be used to promote, endorse or advertise any
308
+ Modified Version, except to acknowledge the contribution(s) of the
309
+ Copyright Holder(s) and the Author(s) or with their explicit written
310
+ permission.
311
+
312
+ 5) The Font Software, modified or unmodified, in part or in whole,
313
+ must be distributed entirely under this license, and must not be
314
+ distributed under any other license. The requirement for fonts to
315
+ remain under this license does not apply to any document created
316
+ using the Font Software.
317
+
318
+ TERMINATION
319
+ This license becomes null and void if any of the above conditions are
320
+ not met.
321
+
322
+ DISCLAIMER
323
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
324
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
325
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
326
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
327
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
328
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
329
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
330
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
331
+ OTHER DEALINGS IN THE FONT SOFTWARE.
332
+
333
+ --------------------------------------------------------------------------------
334
+
335
+ # Code: MIT License (https://opensource.org/licenses/MIT)
336
+
337
+ In the Font Awesome Free download, the MIT license applies to all non-font and
338
+ non-icon files.
339
+
340
+ Copyright 2022 Fonticons, Inc.
341
+
342
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
343
+ this software and associated documentation files (the "Software"), to deal in the
344
+ Software without restriction, including without limitation the rights to use, copy,
345
+ modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
346
+ and to permit persons to whom the Software is furnished to do so, subject to the
347
+ following conditions:
348
+
349
+ The above copyright notice and this permission notice shall be included in all
350
+ copies or substantial portions of the Software.
351
+
352
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
353
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
354
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
355
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
356
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
357
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
358
+
359
+ --------------------------------------------------------------------------------
360
+
361
+ # Attribution
362
+
363
+ Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
364
+ Awesome Free files already contain embedded comments with sufficient
365
+ attribution, so you shouldn't need to do anything additional when using these
366
+ files normally.
367
+
368
+ We've kept attribution comments terse, so we ask that you do not actively work
369
+ to remove them from files, especially code. They're a great way for folks to
370
+ learn about Font Awesome.
371
+
372
+ --------------------------------------------------------------------------------
373
+
374
+ # Brand Icons
375
+
376
+ All brand icons are trademarks of their respective owners. The use of these
377
+ trademarks does not indicate endorsement of the trademark holder by Font
378
+ Awesome, nor vice versa. **Please do not use brand logos for any purpose except
379
+ to represent the company, product, or service to which they refer.**
380
+
381
+
213
382
  @fortawesome/free-solid-svg-icons
214
383
  (CC-BY-4.0 AND MIT)
215
384
  Fonticons, Inc. (https://fontawesome.com)