homey-api 1.9.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.
@@ -308,9 +308,11 @@ class Manager extends EventEmitter {
308
308
  }
309
309
  case 'getAll': {
310
310
  // Add all to cache
311
+ const currentKeys = {};
311
312
  for (const [resultKey, item] of Object.entries(result)) {
312
313
  const key = getItemKey(item);
313
314
  const uri = getItemUri(item);
315
+ currentKeys[key] = true;
314
316
 
315
317
  if (this.__cache[itemId][key]) {
316
318
  result[resultKey] = this.__cache[itemId][key].__update(item);
@@ -334,7 +336,7 @@ class Manager extends EventEmitter {
334
336
  for (const cachedItem of Object.values(this.__cache[itemId])) {
335
337
  const key = getItemKey(cachedItem);
336
338
 
337
- if (!result[key]) {
339
+ if (!currentKeys[key]) {
338
340
  delete this.__cache[itemId][key];
339
341
  }
340
342
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homey-api",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Homey API",
5
5
  "main": "index.js",
6
6
  "files": [