homey-api 1.10.14 → 1.10.15

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.
@@ -209,7 +209,7 @@ class Manager extends EventEmitter {
209
209
  // try to get the CRUD Item from Cache.
210
210
  if (this.isConnected() && operation.crud && $cache === true) {
211
211
  const itemId = items[operation.crud.item].id;
212
- const itemType = items[operation.crud.item].type;
212
+ const itemType = items[operation.crud.item].type || 'id';
213
213
 
214
214
  switch (operation.crud.type) {
215
215
  case 'getOne': {
@@ -291,7 +291,7 @@ class Manager extends EventEmitter {
291
291
  // Transform and cache output if this is a CRUD call
292
292
  if (operation.crud) {
293
293
  const itemId = items[operation.crud.item].id;
294
- const itemType = items[operation.crud.item].type;
294
+ const itemType = items[operation.crud.item].type || 'id';
295
295
  const ItemClass = this.constructor.ITEMS[itemId] || Item;
296
296
  const getItemKey = props => {
297
297
  if (itemType === 'filter') return `${props.uri}:${props.id}`;
@@ -460,7 +460,7 @@ class Manager extends EventEmitter {
460
460
  || event.endsWith('.delete')) {
461
461
  const [itemId, operation] = event.split('.');
462
462
  const ItemClass = this.constructor.ITEMS[itemId] || Item;
463
- const itemType = this.__itemsById[itemId].type;
463
+ const itemType = this.__itemsById[itemId].type || 'id';
464
464
  const key = itemType === 'filter'
465
465
  ? `${data.uri}:${data.id}`
466
466
  : `${data.id}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homey-api",
3
- "version": "1.10.14",
3
+ "version": "1.10.15",
4
4
  "description": "Homey API",
5
5
  "main": "index.js",
6
6
  "files": [