homey-api 1.8.0 → 1.9.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.
- package/assets/specifications/HomeyAPIV3Cloud.json +606 -130
- package/assets/specifications/HomeyAPIV3Local.json +361 -48
- package/assets/types/homey-api.d.ts +924 -128
- package/assets/types/homey-api.private.d.ts +973 -111
- package/lib/HomeyAPI/HomeyAPIV2/Manager.js +7 -1
- package/lib/HomeyAPI/HomeyAPIV2.js +7 -0
- package/package.json +1 -1
|
@@ -152,6 +152,10 @@ class Manager extends EventEmitter {
|
|
|
152
152
|
if (parameter.type === 'array' && !Array.isArray(value)) {
|
|
153
153
|
throw new Error(`Invalid Parameter Type: ${parameterId}. Got: ${typeof value}. Expected: array`);
|
|
154
154
|
}
|
|
155
|
+
|
|
156
|
+
if (Array.isArray(parameter.type)) {
|
|
157
|
+
// TODO
|
|
158
|
+
}
|
|
155
159
|
}
|
|
156
160
|
}
|
|
157
161
|
|
|
@@ -304,9 +308,11 @@ class Manager extends EventEmitter {
|
|
|
304
308
|
}
|
|
305
309
|
case 'getAll': {
|
|
306
310
|
// Add all to cache
|
|
311
|
+
const currentKeys = {};
|
|
307
312
|
for (const [resultKey, item] of Object.entries(result)) {
|
|
308
313
|
const key = getItemKey(item);
|
|
309
314
|
const uri = getItemUri(item);
|
|
315
|
+
currentKeys[key] = true;
|
|
310
316
|
|
|
311
317
|
if (this.__cache[itemId][key]) {
|
|
312
318
|
result[resultKey] = this.__cache[itemId][key].__update(item);
|
|
@@ -330,7 +336,7 @@ class Manager extends EventEmitter {
|
|
|
330
336
|
for (const cachedItem of Object.values(this.__cache[itemId])) {
|
|
331
337
|
const key = getItemKey(cachedItem);
|
|
332
338
|
|
|
333
|
-
if (!
|
|
339
|
+
if (!currentKeys[key]) {
|
|
334
340
|
delete this.__cache[itemId][key];
|
|
335
341
|
}
|
|
336
342
|
}
|
|
@@ -31,6 +31,7 @@ class HomeyAPIV2 extends HomeyAPI {
|
|
|
31
31
|
HomeyAPI.DISCOVERY_STRATEGIES.CLOUD,
|
|
32
32
|
HomeyAPI.DISCOVERY_STRATEGIES.LOCAL,
|
|
33
33
|
HomeyAPI.DISCOVERY_STRATEGIES.LOCAL_SECURE,
|
|
34
|
+
HomeyAPI.DISCOVERY_STRATEGIES.REMOTE_FORWARDED,
|
|
34
35
|
],
|
|
35
36
|
...props
|
|
36
37
|
}) {
|
|
@@ -178,6 +179,12 @@ class HomeyAPIV2 extends HomeyAPI {
|
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
181
|
|
|
182
|
+
if (this.__strategies.includes(HomeyAPI.DISCOVERY_STRATEGIES.REMOTE_FORWARDED)) {
|
|
183
|
+
if (this.__properties.remoteUrlForwarded) {
|
|
184
|
+
urls[HomeyAPI.DISCOVERY_STRATEGIES.REMOTE_FORWARDED] = `${this.__properties.remoteUrlForwarded}`;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
181
188
|
if (!Object.keys(urls).length) {
|
|
182
189
|
throw new Error('No Discovery Strategies Available');
|
|
183
190
|
}
|