homey-api 3.4.15 → 3.4.16

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.
@@ -297,7 +297,7 @@ class HomeyAPIV3 extends HomeyAPI {
297
297
 
298
298
  // Ping localSecure (https://xxx-xxx-xxx-xx.homey.homeylocal.com)
299
299
  if (urls[HomeyAPI.DISCOVERY_STRATEGIES.LOCAL_SECURE]) {
300
- pings[HomeyAPI.DISCOVERY_STRATEGIES.LOCAL_SECURE] = ping(HomeyAPI.DISCOVERY_STRATEGIES.LOCAL_SECURE, 3000);
300
+ pings[HomeyAPI.DISCOVERY_STRATEGIES.LOCAL_SECURE] = ping(HomeyAPI.DISCOVERY_STRATEGIES.LOCAL_SECURE, 5000);
301
301
  pings[HomeyAPI.DISCOVERY_STRATEGIES.LOCAL_SECURE].catch(err => {
302
302
  this.__debug(`Ping ${HomeyAPI.DISCOVERY_STRATEGIES.LOCAL_SECURE} Error:`, err && err.message)
303
303
  this.__debug(urls[HomeyAPI.DISCOVERY_STRATEGIES.LOCAL_SECURE]);
@@ -839,7 +839,18 @@ class HomeyAPIV3 extends HomeyAPI {
839
839
  token: this.__token,
840
840
  homeyId: this.id,
841
841
  }, (err, result) => {
842
- if (err) return reject(err);
842
+ if (err) {
843
+ if (err instanceof Error) {
844
+ return reject(err)
845
+ }
846
+
847
+ if (typeof err === 'object') {
848
+ return reject(new Error(err.message));
849
+ }
850
+
851
+ return reject(new Error(String(err)));
852
+ }
853
+
843
854
  return resolve(result);
844
855
  });
845
856
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homey-api",
3
- "version": "3.4.15",
3
+ "version": "3.4.16",
4
4
  "description": "Homey API",
5
5
  "main": "index.js",
6
6
  "files": [