homey-api 3.4.16 → 3.4.17

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.
@@ -72,6 +72,12 @@ class HomeyAPIV3 extends HomeyAPI {
72
72
  writable: true,
73
73
  });
74
74
 
75
+ Object.defineProperty(this, '__destroyed', {
76
+ value: false,
77
+ enumerable: false,
78
+ writable: true,
79
+ });
80
+
75
81
  Object.defineProperty(this, '__token', {
76
82
  value: token,
77
83
  enumerable: false,
@@ -779,6 +785,8 @@ class HomeyAPIV3 extends HomeyAPI {
779
785
  }
780
786
 
781
787
  destroy() {
788
+ this.__destroyed = true;
789
+
782
790
  if (this.__homeySocket) {
783
791
  this.__homeySocket.removeAllListeners();
784
792
  this.__homeySocket.close();
@@ -794,6 +802,10 @@ class HomeyAPIV3 extends HomeyAPI {
794
802
  this.removeAllListeners();
795
803
  }
796
804
 
805
+ isDestroyed() {
806
+ return this.__destroyed;
807
+ }
808
+
797
809
  async __handshakeClient() {
798
810
  this.__debug('__handshakeClient');
799
811
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homey-api",
3
- "version": "3.4.16",
3
+ "version": "3.4.17",
4
4
  "description": "Homey API",
5
5
  "main": "index.js",
6
6
  "files": [