homey-api 3.14.2 → 3.14.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.
@@ -3,15 +3,14 @@
3
3
  const DriverV3 = require('../../HomeyAPIV3/ManagerDrivers/Driver');
4
4
 
5
5
  class Driver extends DriverV3 {
6
-
7
6
  static transformGet(item) {
8
7
  item = super.transformGet(item);
9
8
 
10
9
  item.ownerId = item.id;
11
10
  item.ownerUri = item.uri;
12
- item.ownerName = item.uriObj.name;
13
- item.ownerIconObj = item.uriObj.iconObj;
14
- item.color = item.uriObj.color;
11
+ item.ownerName = item.uriObj?.name;
12
+ item.ownerIconObj = item.uriObj?.iconObj;
13
+ item.color = item.uriObj?.color;
15
14
  item.id = `${item.uri}:${item.id}`;
16
15
 
17
16
  delete item.uri;
@@ -19,7 +18,6 @@ class Driver extends DriverV3 {
19
18
 
20
19
  return item;
21
20
  }
22
-
23
21
  }
24
22
 
25
23
  module.exports = Driver;
@@ -35,7 +35,7 @@ class AdvancedFlow extends AdvancedFlowV3 {
35
35
  nextItem.cards[key] = {
36
36
  ...card,
37
37
  ownerUri: card.id.split(':', 3).join(':'),
38
- id: card.id.split(':').reverse()[0],
38
+ id: card.id.split(':').slice(3).join(':'),
39
39
  };
40
40
  }
41
41
  }
package/lib/Util.js CHANGED
@@ -58,6 +58,11 @@ class Util {
58
58
  }
59
59
  }
60
60
 
61
+ if (err.type === 'aborted') {
62
+ // https://github.com/node-fetch/node-fetch/blob/2.x/src/abort-error.js
63
+ throw new APIErrorTimeout(timeoutMessage ?? `Timeout after ${timeoutDuration}ms`);
64
+ }
65
+
61
66
  throw err;
62
67
  } finally {
63
68
  clearTimeout(abortTimeout);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homey-api",
3
- "version": "3.14.2",
3
+ "version": "3.14.4",
4
4
  "description": "Homey API",
5
5
  "main": "index.js",
6
6
  "files": [