homey-lib 2.45.2 → 2.45.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.
- package/.eslintignore +2 -1
- package/assets/app/schema.d.ts +507 -0
- package/assets/capability/schema.d.ts +53 -0
- package/helpers/index.js +11 -0
- package/index.js +47 -24
- package/lib/App/index.js +125 -7
- package/lib/Capability/index.js +42 -0
- package/lib/Device/index.js +10 -0
- package/lib/Energy/index.js +6 -0
- package/lib/Media/index.js +3 -0
- package/lib/Signal/index.js +25 -0
- package/lib/Signal/validators.js +21 -0
- package/lib/Util/index.js +10 -0
- package/package.json +11 -3
- package/tsconfig.types.json +15 -0
- package/types/assets/app/schema.d.ts +507 -0
- package/types/assets/capability/schema.d.ts +53 -0
- package/types/helpers/index.d.ts +11 -0
- package/types/helpers/index.d.ts.map +1 -0
- package/types/index.d.ts +23 -0
- package/types/index.d.ts.map +1 -0
- package/types/lib/App/index.d.ts +140 -0
- package/types/lib/App/index.d.ts.map +1 -0
- package/types/lib/Capability/index.d.ts +61 -0
- package/types/lib/Capability/index.d.ts.map +1 -0
- package/types/lib/Device/index.d.ts +18 -0
- package/types/lib/Device/index.d.ts.map +1 -0
- package/types/lib/Energy/index.d.ts +12 -0
- package/types/lib/Energy/index.d.ts.map +1 -0
- package/types/lib/Media/index.d.ts +8 -0
- package/types/lib/Media/index.d.ts.map +1 -0
- package/types/lib/Signal/index.d.ts +52 -0
- package/types/lib/Signal/index.d.ts.map +1 -0
- package/types/lib/Signal/validators.d.ts +37 -0
- package/types/lib/Signal/validators.d.ts.map +1 -0
- package/types/lib/Util/index.d.ts +23 -0
- package/types/lib/Util/index.d.ts.map +1 -0
- package/webpack/index.js +1 -1
package/.eslintignore
CHANGED
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type I18NObject =
|
|
9
|
+
| string
|
|
10
|
+
| {
|
|
11
|
+
/**
|
|
12
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
13
|
+
* via the `patternProperty` "^.*$".
|
|
14
|
+
*/
|
|
15
|
+
[k: string]: string;
|
|
16
|
+
};
|
|
17
|
+
export type DriverSettings = (
|
|
18
|
+
| {
|
|
19
|
+
type: "text" | "password" | "textarea" | "label";
|
|
20
|
+
id: string | number;
|
|
21
|
+
label: I18NObject;
|
|
22
|
+
hint?: I18NObject;
|
|
23
|
+
value?: string;
|
|
24
|
+
pattern?: string;
|
|
25
|
+
highlight?: true;
|
|
26
|
+
zwave?: ZwaveSetting;
|
|
27
|
+
[k: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
type: "number" | "slider";
|
|
31
|
+
id: string | number;
|
|
32
|
+
label: I18NObject;
|
|
33
|
+
hint?: I18NObject;
|
|
34
|
+
value?: number;
|
|
35
|
+
units?: I18NObject;
|
|
36
|
+
attr?: {
|
|
37
|
+
min?: number;
|
|
38
|
+
max?: number;
|
|
39
|
+
step?: number;
|
|
40
|
+
[k: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
min?: number;
|
|
43
|
+
max?: number;
|
|
44
|
+
step?: number;
|
|
45
|
+
highlight?: true;
|
|
46
|
+
zwave?: ZwaveSetting;
|
|
47
|
+
[k: string]: unknown;
|
|
48
|
+
}
|
|
49
|
+
| {
|
|
50
|
+
type: "radio" | "dropdown";
|
|
51
|
+
id: string | number;
|
|
52
|
+
label: I18NObject;
|
|
53
|
+
hint?: I18NObject;
|
|
54
|
+
value?: string;
|
|
55
|
+
values: {
|
|
56
|
+
id: string;
|
|
57
|
+
label: I18NObject;
|
|
58
|
+
[k: string]: unknown;
|
|
59
|
+
}[];
|
|
60
|
+
highlight?: true;
|
|
61
|
+
zwave?: ZwaveSetting;
|
|
62
|
+
[k: string]: unknown;
|
|
63
|
+
}
|
|
64
|
+
| {
|
|
65
|
+
type: "checkbox";
|
|
66
|
+
id: string | number;
|
|
67
|
+
label: I18NObject;
|
|
68
|
+
hint?: I18NObject;
|
|
69
|
+
value?: boolean;
|
|
70
|
+
highlight?: true;
|
|
71
|
+
zwave?: ZwaveSetting;
|
|
72
|
+
[k: string]: unknown;
|
|
73
|
+
}
|
|
74
|
+
| {
|
|
75
|
+
type: "group";
|
|
76
|
+
label: I18NObject;
|
|
77
|
+
children: DriverSettings;
|
|
78
|
+
highlight?: true;
|
|
79
|
+
zwave?: ZwaveSetting;
|
|
80
|
+
[k: string]: unknown;
|
|
81
|
+
}
|
|
82
|
+
)[];
|
|
83
|
+
export type AppSettings = (
|
|
84
|
+
| {
|
|
85
|
+
type: "text" | "password" | "textarea" | "label";
|
|
86
|
+
id: string;
|
|
87
|
+
title: I18NObject;
|
|
88
|
+
hint?: I18NObject;
|
|
89
|
+
value?: string;
|
|
90
|
+
pattern?: string;
|
|
91
|
+
[k: string]: unknown;
|
|
92
|
+
}
|
|
93
|
+
| {
|
|
94
|
+
type: "number" | "slider";
|
|
95
|
+
id: string;
|
|
96
|
+
title: I18NObject;
|
|
97
|
+
hint?: I18NObject;
|
|
98
|
+
value?: number;
|
|
99
|
+
units?: I18NObject;
|
|
100
|
+
min?: number;
|
|
101
|
+
max?: number;
|
|
102
|
+
step?: number;
|
|
103
|
+
[k: string]: unknown;
|
|
104
|
+
}
|
|
105
|
+
| {
|
|
106
|
+
type: "radio" | "dropdown";
|
|
107
|
+
id: string;
|
|
108
|
+
title: I18NObject;
|
|
109
|
+
hint?: I18NObject;
|
|
110
|
+
value?: string;
|
|
111
|
+
values: {
|
|
112
|
+
id: string;
|
|
113
|
+
title: I18NObject;
|
|
114
|
+
[k: string]: unknown;
|
|
115
|
+
}[];
|
|
116
|
+
[k: string]: unknown;
|
|
117
|
+
}
|
|
118
|
+
| {
|
|
119
|
+
type: "checkbox";
|
|
120
|
+
id: string;
|
|
121
|
+
title: I18NObject;
|
|
122
|
+
hint?: I18NObject;
|
|
123
|
+
value?: boolean;
|
|
124
|
+
[k: string]: unknown;
|
|
125
|
+
}
|
|
126
|
+
| {
|
|
127
|
+
type: "group";
|
|
128
|
+
title: I18NObject;
|
|
129
|
+
children: AppSettings;
|
|
130
|
+
[k: string]: unknown;
|
|
131
|
+
}
|
|
132
|
+
)[];
|
|
133
|
+
|
|
134
|
+
export interface App {
|
|
135
|
+
id: string;
|
|
136
|
+
name: I18NObject;
|
|
137
|
+
description?: I18NObject;
|
|
138
|
+
author: Author;
|
|
139
|
+
images?: Images;
|
|
140
|
+
version: string;
|
|
141
|
+
compatibility: string;
|
|
142
|
+
sdk?: number;
|
|
143
|
+
platforms?: ("cloud" | "local")[];
|
|
144
|
+
platformLocalRequiredFeatures?: ("nfc" | "speaker" | "ledring" | "matter" | "camera-streaming")[];
|
|
145
|
+
platformLocalOptionalFeatures?: ("nfc" | "speaker" | "ledring" | "matter" | "camera-streaming")[];
|
|
146
|
+
runtime?: "nodejs" | "python";
|
|
147
|
+
pythonVersion?: string;
|
|
148
|
+
pythonPackages?: string[];
|
|
149
|
+
tags?: I18NArray;
|
|
150
|
+
permissions?: string[];
|
|
151
|
+
bugs?: {
|
|
152
|
+
url?: string;
|
|
153
|
+
[k: string]: unknown;
|
|
154
|
+
};
|
|
155
|
+
homepage?: string;
|
|
156
|
+
support?: string;
|
|
157
|
+
source?: string;
|
|
158
|
+
athomForumDiscussionId?: number;
|
|
159
|
+
homeyCommunityTopicId?: number;
|
|
160
|
+
category?: string | string[];
|
|
161
|
+
contributors?: {
|
|
162
|
+
/**
|
|
163
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
164
|
+
* via the `patternProperty` "^(developers|translators)$".
|
|
165
|
+
*/
|
|
166
|
+
[k: string]: Author[];
|
|
167
|
+
};
|
|
168
|
+
contributing?: {
|
|
169
|
+
donate?: {
|
|
170
|
+
githubSponsors?: {
|
|
171
|
+
username?: string;
|
|
172
|
+
};
|
|
173
|
+
bunq?: {
|
|
174
|
+
username?: string;
|
|
175
|
+
};
|
|
176
|
+
patreon?: {
|
|
177
|
+
username?: string;
|
|
178
|
+
};
|
|
179
|
+
paypal?: {
|
|
180
|
+
username?: string;
|
|
181
|
+
email?: string;
|
|
182
|
+
fundraiserCharityId?: number;
|
|
183
|
+
currency?: string;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
[k: string]: unknown;
|
|
187
|
+
};
|
|
188
|
+
screensavers?: {
|
|
189
|
+
name?: string;
|
|
190
|
+
title?: I18NObject;
|
|
191
|
+
[k: string]: unknown;
|
|
192
|
+
}[];
|
|
193
|
+
capabilities?: {
|
|
194
|
+
/**
|
|
195
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
196
|
+
* via the `patternProperty` "^.*$".
|
|
197
|
+
*/
|
|
198
|
+
[k: string]: {
|
|
199
|
+
[k: string]: unknown;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
drivers?: {
|
|
203
|
+
id: string;
|
|
204
|
+
name: I18NObject;
|
|
205
|
+
class: string;
|
|
206
|
+
capabilities: string[];
|
|
207
|
+
capabilitiesOptions?: {
|
|
208
|
+
[k: string]: unknown;
|
|
209
|
+
};
|
|
210
|
+
images?: Images;
|
|
211
|
+
deprecated?: true;
|
|
212
|
+
discovery?: string;
|
|
213
|
+
energy?: {
|
|
214
|
+
approximation?:
|
|
215
|
+
| {
|
|
216
|
+
usageOn: number;
|
|
217
|
+
usageOff: number;
|
|
218
|
+
}
|
|
219
|
+
| {
|
|
220
|
+
usageConstant: number;
|
|
221
|
+
};
|
|
222
|
+
cumulative?: true;
|
|
223
|
+
cumulativeImportedCapability?: string;
|
|
224
|
+
cumulativeExportedCapability?: string;
|
|
225
|
+
electricCar?: true;
|
|
226
|
+
evCharger?: true;
|
|
227
|
+
homeBattery?: true;
|
|
228
|
+
meterPowerImportedCapability?: string;
|
|
229
|
+
meterPowerExportedCapability?: string;
|
|
230
|
+
/**
|
|
231
|
+
* @minItems 1
|
|
232
|
+
*/
|
|
233
|
+
batteries?: [string, ...string[]];
|
|
234
|
+
[k: string]: unknown;
|
|
235
|
+
};
|
|
236
|
+
pair?: {
|
|
237
|
+
id: string;
|
|
238
|
+
template?: string;
|
|
239
|
+
options?: {
|
|
240
|
+
[k: string]: unknown;
|
|
241
|
+
};
|
|
242
|
+
navigation?: {
|
|
243
|
+
prev?: string;
|
|
244
|
+
next?: string;
|
|
245
|
+
[k: string]: unknown;
|
|
246
|
+
};
|
|
247
|
+
[k: string]: unknown;
|
|
248
|
+
}[];
|
|
249
|
+
settings?: DriverSettings;
|
|
250
|
+
gtin?: string | string[];
|
|
251
|
+
matter?: MatterDevice;
|
|
252
|
+
zwave?: ZwaveDevice;
|
|
253
|
+
zigbee?: ZigbeeDevice;
|
|
254
|
+
rf433?: {
|
|
255
|
+
satelliteMode?: boolean;
|
|
256
|
+
[k: string]: unknown;
|
|
257
|
+
};
|
|
258
|
+
infrared?: {
|
|
259
|
+
satelliteMode?: boolean;
|
|
260
|
+
[k: string]: unknown;
|
|
261
|
+
};
|
|
262
|
+
platforms?: ("cloud" | "local")[];
|
|
263
|
+
connectivity?: ("lan" | "cloud" | "ble" | "zwave" | "zigbee" | "infrared" | "rf433" | "rf868" | "matter")[];
|
|
264
|
+
[k: string]: unknown;
|
|
265
|
+
}[];
|
|
266
|
+
flow?: {
|
|
267
|
+
triggers?: FlowCard[];
|
|
268
|
+
conditions?: FlowCard[];
|
|
269
|
+
actions?: FlowCard[];
|
|
270
|
+
[k: string]: unknown;
|
|
271
|
+
};
|
|
272
|
+
signals?: {
|
|
273
|
+
/**
|
|
274
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
275
|
+
* via the `patternProperty` "^(433|868|ir)$".
|
|
276
|
+
*/
|
|
277
|
+
[k: string]: {
|
|
278
|
+
[k: string]: unknown;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
brandColor?: string;
|
|
282
|
+
discovery?: {
|
|
283
|
+
/**
|
|
284
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
285
|
+
* via the `patternProperty` "^.*$".
|
|
286
|
+
*/
|
|
287
|
+
[k: string]: {
|
|
288
|
+
type: "mdns-sd" | "ssdp" | "mac";
|
|
289
|
+
id?: string;
|
|
290
|
+
conditions?: {
|
|
291
|
+
field: string;
|
|
292
|
+
match: {
|
|
293
|
+
type: "string" | "regex";
|
|
294
|
+
value: string;
|
|
295
|
+
};
|
|
296
|
+
}[][];
|
|
297
|
+
"mdns-sd"?: {
|
|
298
|
+
name: string;
|
|
299
|
+
protocol: "tcp" | "udp";
|
|
300
|
+
};
|
|
301
|
+
ssdp?: {
|
|
302
|
+
search: string;
|
|
303
|
+
};
|
|
304
|
+
mac?: {
|
|
305
|
+
/**
|
|
306
|
+
* @minItems 1
|
|
307
|
+
* @maxItems 32
|
|
308
|
+
*/
|
|
309
|
+
manufacturer: [[number, number, number], ...[number, number, number][]];
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
widgets?: {
|
|
314
|
+
/**
|
|
315
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
316
|
+
* via the `patternProperty` "^.*$".
|
|
317
|
+
*/
|
|
318
|
+
[k: string]: {
|
|
319
|
+
name: I18NObject;
|
|
320
|
+
height?: number | string;
|
|
321
|
+
transparent?: boolean;
|
|
322
|
+
settings?: unknown[];
|
|
323
|
+
devices?: {
|
|
324
|
+
type: "global" | "app";
|
|
325
|
+
singular: boolean;
|
|
326
|
+
filter?: {
|
|
327
|
+
class?: string;
|
|
328
|
+
capabilities?: string;
|
|
329
|
+
[k: string]: unknown;
|
|
330
|
+
};
|
|
331
|
+
[k: string]: unknown;
|
|
332
|
+
};
|
|
333
|
+
api?: {
|
|
334
|
+
/**
|
|
335
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
336
|
+
* via the `patternProperty` "^.*$".
|
|
337
|
+
*/
|
|
338
|
+
[k: string]: {
|
|
339
|
+
method: "GET" | "POST" | "PUT" | "DELETE";
|
|
340
|
+
path: string;
|
|
341
|
+
[k: string]: unknown;
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
id: string;
|
|
345
|
+
deprecated?: boolean;
|
|
346
|
+
[k: string]: unknown;
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
settings?: AppSettings;
|
|
350
|
+
[k: string]: unknown;
|
|
351
|
+
}
|
|
352
|
+
export interface Author {
|
|
353
|
+
name: string;
|
|
354
|
+
email?: string;
|
|
355
|
+
website?: string;
|
|
356
|
+
[k: string]: unknown;
|
|
357
|
+
}
|
|
358
|
+
export interface Images {
|
|
359
|
+
large: string;
|
|
360
|
+
small: string;
|
|
361
|
+
xlarge?: string;
|
|
362
|
+
}
|
|
363
|
+
export interface I18NArray {
|
|
364
|
+
/**
|
|
365
|
+
* This interface was referenced by `I18NArray`'s JSON-Schema definition
|
|
366
|
+
* via the `patternProperty` "^.*$".
|
|
367
|
+
*/
|
|
368
|
+
[k: string]: string[];
|
|
369
|
+
}
|
|
370
|
+
export interface ZwaveSetting {
|
|
371
|
+
index: number;
|
|
372
|
+
size: 1 | 2 | 4;
|
|
373
|
+
signed?: boolean;
|
|
374
|
+
[k: string]: unknown;
|
|
375
|
+
}
|
|
376
|
+
export interface MatterDevice {
|
|
377
|
+
vendorId: number | number[];
|
|
378
|
+
productId: number | number[];
|
|
379
|
+
deviceVendorId?: number | number[];
|
|
380
|
+
deviceProductName?: string | string[];
|
|
381
|
+
learnmode?: {
|
|
382
|
+
image?: string;
|
|
383
|
+
instruction: I18NObject;
|
|
384
|
+
[k: string]: unknown;
|
|
385
|
+
};
|
|
386
|
+
[k: string]: unknown;
|
|
387
|
+
}
|
|
388
|
+
export interface ZwaveDevice {
|
|
389
|
+
manufacturerId: number | number[];
|
|
390
|
+
productTypeId: number | number[];
|
|
391
|
+
productId: number | number[];
|
|
392
|
+
learnmode?: {
|
|
393
|
+
image?: string;
|
|
394
|
+
instruction: I18NObject;
|
|
395
|
+
[k: string]: unknown;
|
|
396
|
+
};
|
|
397
|
+
associationGroups?: number[];
|
|
398
|
+
associationGroupsMultiChannel?: number[];
|
|
399
|
+
associationGroupsOptions?: {
|
|
400
|
+
hint?: I18NObject;
|
|
401
|
+
[k: string]: unknown;
|
|
402
|
+
};
|
|
403
|
+
wakeUpInterval?: number;
|
|
404
|
+
defaultConfiguration?: {
|
|
405
|
+
id: number;
|
|
406
|
+
size: 1 | 2 | 4;
|
|
407
|
+
value: number | string;
|
|
408
|
+
multiChannelNodes?: {
|
|
409
|
+
[k: string]: unknown;
|
|
410
|
+
};
|
|
411
|
+
[k: string]: unknown;
|
|
412
|
+
}[];
|
|
413
|
+
[k: string]: unknown;
|
|
414
|
+
}
|
|
415
|
+
export interface ZigbeeDevice {
|
|
416
|
+
manufacturerName: string | string[];
|
|
417
|
+
productId: string | string[];
|
|
418
|
+
endpoints: {
|
|
419
|
+
[k: string]: {
|
|
420
|
+
clusters?: number[];
|
|
421
|
+
bindings?: number[];
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
learnmode?: {
|
|
425
|
+
image?: string;
|
|
426
|
+
instruction: I18NObject;
|
|
427
|
+
[k: string]: unknown;
|
|
428
|
+
};
|
|
429
|
+
[k: string]: unknown;
|
|
430
|
+
}
|
|
431
|
+
export interface FlowCard {
|
|
432
|
+
id: string;
|
|
433
|
+
title: I18NObject;
|
|
434
|
+
titleFormatted?: I18NObject;
|
|
435
|
+
deprecated?: true;
|
|
436
|
+
highlight?: true;
|
|
437
|
+
advanced?: true;
|
|
438
|
+
platforms?: ("cloud" | "local")[];
|
|
439
|
+
droptoken?: ("boolean" | "number" | "string" | "image") | ("boolean" | "number" | "string" | "image")[];
|
|
440
|
+
tokens?: {
|
|
441
|
+
name: string;
|
|
442
|
+
type?: "boolean" | "number" | "string" | "image";
|
|
443
|
+
title: I18NObject;
|
|
444
|
+
example?: I18NObject | number | boolean;
|
|
445
|
+
[k: string]: unknown;
|
|
446
|
+
}[];
|
|
447
|
+
args?: (
|
|
448
|
+
| {
|
|
449
|
+
name: string;
|
|
450
|
+
type: "device";
|
|
451
|
+
filter:
|
|
452
|
+
| string
|
|
453
|
+
| {
|
|
454
|
+
[k: string]: unknown;
|
|
455
|
+
};
|
|
456
|
+
[k: string]: unknown;
|
|
457
|
+
}
|
|
458
|
+
| {
|
|
459
|
+
title?: I18NObject;
|
|
460
|
+
name: string;
|
|
461
|
+
type: "text" | "autocomplete" | "device" | "date" | "time" | "color" | "checkbox" | "code";
|
|
462
|
+
placeholder?: I18NObject;
|
|
463
|
+
filter?:
|
|
464
|
+
| string
|
|
465
|
+
| {
|
|
466
|
+
[k: string]: unknown;
|
|
467
|
+
};
|
|
468
|
+
[k: string]: unknown;
|
|
469
|
+
}
|
|
470
|
+
| {
|
|
471
|
+
title?: I18NObject;
|
|
472
|
+
name: string;
|
|
473
|
+
type: "number" | "range";
|
|
474
|
+
min?: number;
|
|
475
|
+
max?: number;
|
|
476
|
+
step?: number;
|
|
477
|
+
label?: I18NObject;
|
|
478
|
+
labelMultiplier?: number;
|
|
479
|
+
labelDecimals?: number;
|
|
480
|
+
[k: string]: unknown;
|
|
481
|
+
}
|
|
482
|
+
| {
|
|
483
|
+
title?: I18NObject;
|
|
484
|
+
name: string;
|
|
485
|
+
type: "dropdown";
|
|
486
|
+
values: {
|
|
487
|
+
id: string;
|
|
488
|
+
title?: I18NObject;
|
|
489
|
+
[k: string]: unknown;
|
|
490
|
+
}[];
|
|
491
|
+
[k: string]: unknown;
|
|
492
|
+
}
|
|
493
|
+
| {
|
|
494
|
+
title?: I18NObject;
|
|
495
|
+
name: string;
|
|
496
|
+
type: "multiselect";
|
|
497
|
+
conjunction: "and" | "or";
|
|
498
|
+
values: {
|
|
499
|
+
id: string;
|
|
500
|
+
title: I18NObject;
|
|
501
|
+
[k: string]: unknown;
|
|
502
|
+
}[];
|
|
503
|
+
[k: string]: unknown;
|
|
504
|
+
}
|
|
505
|
+
)[];
|
|
506
|
+
[k: string]: unknown;
|
|
507
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type Capability = {
|
|
9
|
+
[k: string]: unknown;
|
|
10
|
+
} & {
|
|
11
|
+
title: I18NObject;
|
|
12
|
+
desc?: I18NObject;
|
|
13
|
+
type: "boolean" | "number" | "string" | "enum";
|
|
14
|
+
getable?: boolean;
|
|
15
|
+
setable?: boolean;
|
|
16
|
+
icon?: string;
|
|
17
|
+
insights?: boolean;
|
|
18
|
+
insightsTitleTrue?: I18NObject;
|
|
19
|
+
insightsTitleFalse?: I18NObject;
|
|
20
|
+
chartType?: "line" | "area" | "stepLine" | "column" | "spline" | "splineArea" | "scatter";
|
|
21
|
+
decimals?: number;
|
|
22
|
+
min?: number;
|
|
23
|
+
max?: number;
|
|
24
|
+
step?: number;
|
|
25
|
+
units?: I18NObject;
|
|
26
|
+
values?: {
|
|
27
|
+
id: string;
|
|
28
|
+
title: I18NObject;
|
|
29
|
+
[k: string]: unknown;
|
|
30
|
+
}[];
|
|
31
|
+
uiComponent?:
|
|
32
|
+
| ("thermostat" | "media" | "toggle" | "slider" | "ternary" | "button" | "color" | "picker" | "sensor" | "battery")
|
|
33
|
+
| null;
|
|
34
|
+
[k: string]: unknown;
|
|
35
|
+
} & (
|
|
36
|
+
| {
|
|
37
|
+
type?: "enum";
|
|
38
|
+
[k: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
| {
|
|
41
|
+
type?: "boolean" | "number" | "string";
|
|
42
|
+
[k: string]: unknown;
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
export type I18NObject =
|
|
46
|
+
| string
|
|
47
|
+
| {
|
|
48
|
+
/**
|
|
49
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
50
|
+
* via the `patternProperty` "^.*$".
|
|
51
|
+
*/
|
|
52
|
+
[k: string]: string;
|
|
53
|
+
};
|
package/helpers/index.js
CHANGED
|
@@ -9,20 +9,31 @@ try {
|
|
|
9
9
|
const imageSize = require('image-size');
|
|
10
10
|
|
|
11
11
|
if (fs && util && util.promisify) {
|
|
12
|
+
/** @type {typeof fs.open.__promisify__} */
|
|
12
13
|
module.exports.openAsync = util.promisify(fs.open);
|
|
14
|
+
/** @type {typeof fs.close.__promisify__} */
|
|
13
15
|
module.exports.closeAsync = util.promisify(fs.close);
|
|
16
|
+
/** @type {typeof fs.read.__promisify__} */
|
|
14
17
|
module.exports.readAsync = util.promisify(fs.read);
|
|
18
|
+
/** @type {typeof fs.stat.__promisify__} */
|
|
15
19
|
module.exports.statAsync = util.promisify(fs.stat);
|
|
20
|
+
/** @type {typeof fs.readFile.__promisify__} */
|
|
16
21
|
module.exports.readFileAsync = util.promisify(fs.readFile);
|
|
22
|
+
/** @type {typeof fs.readdir.__promisify__} */
|
|
17
23
|
module.exports.readDirAsync = util.promisify(fs.readdir);
|
|
24
|
+
/** @type {typeof fs.lstat.__promisify__} */
|
|
18
25
|
module.exports.lstatAsync = util.promisify(fs.lstat);
|
|
19
26
|
module.exports.imageSizeAsync = util.promisify(imageSize);
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
if (path) {
|
|
30
|
+
/** @type {typeof path.join} */
|
|
23
31
|
module.exports.join = path.join;
|
|
32
|
+
/** @type {typeof path.extname} */
|
|
24
33
|
module.exports.extname = path.extname;
|
|
34
|
+
/** @type {typeof path.basename} */
|
|
25
35
|
module.exports.basename = path.basename;
|
|
36
|
+
/** @type {typeof path.dirname} */
|
|
26
37
|
module.exports.dirname = path.dirname;
|
|
27
38
|
}
|
|
28
39
|
} catch (err) {
|
package/index.js
CHANGED
|
@@ -1,26 +1,49 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
module.exports.
|
|
12
|
-
module.exports.
|
|
13
|
-
|
|
14
|
-
module.exports.
|
|
15
|
-
module.exports.
|
|
16
|
-
module.exports.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
module.exports.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
module.exports.
|
|
26
|
-
|
|
3
|
+
const App = require('./lib/App');
|
|
4
|
+
const Capability = require('./lib/Capability');
|
|
5
|
+
const Device = require('./lib/Device');
|
|
6
|
+
const Energy = require('./lib/Energy');
|
|
7
|
+
const Media = require('./lib/Media');
|
|
8
|
+
const Signal = require('./lib/Signal');
|
|
9
|
+
const Util = require('./lib/Util');
|
|
10
|
+
|
|
11
|
+
module.exports.App = App;
|
|
12
|
+
module.exports.Capability = Capability;
|
|
13
|
+
module.exports.Device = Device;
|
|
14
|
+
module.exports.Energy = Energy;
|
|
15
|
+
module.exports.Media = Media;
|
|
16
|
+
module.exports.Signal = Signal;
|
|
17
|
+
module.exports.Util = Util;
|
|
18
|
+
|
|
19
|
+
/** @type {typeof Device.getClasses} */
|
|
20
|
+
module.exports.getDeviceClasses = Device.getClasses.bind(Device);
|
|
21
|
+
/** @type {typeof Device.getClass} */
|
|
22
|
+
module.exports.getDeviceClass = Device.getClass.bind(Device);
|
|
23
|
+
|
|
24
|
+
/** @type {typeof Capability.getCapabilities} */
|
|
25
|
+
module.exports.getCapabilities = Capability.getCapabilities.bind(Capability);
|
|
26
|
+
/** @type {typeof Capability.getCapability} */
|
|
27
|
+
module.exports.getCapability = Capability.getCapability.bind(Capability);
|
|
28
|
+
/** @type {typeof Capability.hasCapability} */
|
|
29
|
+
module.exports.hasCapability = Capability.hasCapability.bind(Capability);
|
|
30
|
+
|
|
31
|
+
/** @type {typeof App.getLocales} */
|
|
32
|
+
module.exports.getAppLocales = App.getLocales.bind(App);
|
|
33
|
+
/** @type {typeof App.getCategories} */
|
|
34
|
+
module.exports.getAppCategories = App.getCategories.bind(App);
|
|
35
|
+
/** @type {typeof App.getPermissions} */
|
|
36
|
+
module.exports.getAppPermissions = App.getPermissions.bind(App);
|
|
37
|
+
/** @type {typeof App.getBrandColor} */
|
|
38
|
+
module.exports.getAppBrandColor = App.getBrandColor.bind(App);
|
|
39
|
+
|
|
40
|
+
/** @type {typeof Media.getCodecs} */
|
|
41
|
+
module.exports.getMediaCodecs = Media.getCodecs.bind(Media);
|
|
42
|
+
|
|
43
|
+
/** @type {typeof Energy.getCurrencies} */
|
|
44
|
+
module.exports.getCurrencies = Energy.getCurrencies.bind(Energy);
|
|
45
|
+
/** @type {typeof Energy.getBatteries} */
|
|
46
|
+
module.exports.getBatteries = Energy.getBatteries.bind(Energy);
|
|
47
|
+
|
|
48
|
+
/** @typedef {import('./assets/app/schema').App} AppManifest */
|
|
49
|
+
/** @typedef {import('./assets/capability/schema').Capability} CapabilityDefinition */
|