homey-api 1.5.23 → 1.5.24
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.
|
@@ -13,7 +13,7 @@ class Item extends EventEmitter {
|
|
|
13
13
|
}) {
|
|
14
14
|
super();
|
|
15
15
|
|
|
16
|
-
// Set
|
|
16
|
+
// Set Homey
|
|
17
17
|
Object.defineProperty(this, 'homey', {
|
|
18
18
|
value: homey,
|
|
19
19
|
enumerable: false,
|
|
@@ -98,10 +98,9 @@ class Item extends EventEmitter {
|
|
|
98
98
|
this.onReconnect();
|
|
99
99
|
},
|
|
100
100
|
onEvent: (event, data) => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
101
|
+
this.__debug('onEvent', event, data);
|
|
102
|
+
|
|
103
|
+
this.emit(event, data);
|
|
105
104
|
},
|
|
106
105
|
});
|
|
107
106
|
}
|
|
@@ -352,6 +352,7 @@ class Manager extends EventEmitter {
|
|
|
352
352
|
result = new ItemClass({
|
|
353
353
|
key,
|
|
354
354
|
uri,
|
|
355
|
+
homey: this.homey,
|
|
355
356
|
manager: this,
|
|
356
357
|
properties: result,
|
|
357
358
|
});
|
|
@@ -447,6 +448,7 @@ class Manager extends EventEmitter {
|
|
|
447
448
|
this.__cache[itemId][key] = new ItemClass({
|
|
448
449
|
key,
|
|
449
450
|
uri,
|
|
451
|
+
homey: this.homey,
|
|
450
452
|
manager: this,
|
|
451
453
|
properties: { ...data },
|
|
452
454
|
});
|
|
@@ -464,6 +466,7 @@ class Manager extends EventEmitter {
|
|
|
464
466
|
this.__cache[itemId][key] = new ItemClass({
|
|
465
467
|
key,
|
|
466
468
|
uri,
|
|
469
|
+
homey: this.homey,
|
|
467
470
|
manager: this,
|
|
468
471
|
properties: { ...data },
|
|
469
472
|
});
|
|
@@ -437,7 +437,10 @@ class HomeyAPIV2 extends HomeyAPI {
|
|
|
437
437
|
// and then sending the JWT token to Homey.
|
|
438
438
|
this.__debug('Retrieving token...');
|
|
439
439
|
const jwtToken = await this.__api.createDelegationToken({ audience: 'homey' });
|
|
440
|
-
const token = await this.users.login({
|
|
440
|
+
const token = await this.users.login({
|
|
441
|
+
$socket: false,
|
|
442
|
+
token: jwtToken,
|
|
443
|
+
});
|
|
441
444
|
await this.__setStore({ token });
|
|
442
445
|
this.__debug('Got token');
|
|
443
446
|
|