homey-api 3.17.10 → 3.17.12
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.
|
@@ -179,11 +179,13 @@ class DiscoveryManager {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
const homeyVersion = response.headers.get('X-Homey-Version');
|
|
182
|
+
const homeyTier = response.headers.get('X-Homey-Tier') ?? null;
|
|
182
183
|
|
|
183
184
|
return {
|
|
184
185
|
baseUrl,
|
|
185
186
|
strategyId,
|
|
186
187
|
homeyVersion,
|
|
188
|
+
homeyTier,
|
|
187
189
|
};
|
|
188
190
|
};
|
|
189
191
|
|
|
@@ -230,10 +230,11 @@ class HomeyAPIV3 extends HomeyAPI {
|
|
|
230
230
|
return result;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
__applyDiscoveryResult({ baseUrl, strategyId, homeyVersion }) {
|
|
233
|
+
__applyDiscoveryResult({ baseUrl, strategyId, homeyVersion, homeyTier }) {
|
|
234
234
|
this.__baseUrl = baseUrl;
|
|
235
235
|
this.__baseUrlPromise = Promise.resolve(baseUrl);
|
|
236
236
|
this.__strategyId = strategyId;
|
|
237
|
+
this.__tierCache[this.id] = homeyTier;
|
|
237
238
|
|
|
238
239
|
if (homeyVersion != null) {
|
|
239
240
|
this.version = homeyVersion;
|
|
@@ -243,6 +244,7 @@ class HomeyAPIV3 extends HomeyAPI {
|
|
|
243
244
|
baseUrl,
|
|
244
245
|
strategyId,
|
|
245
246
|
homeyVersion,
|
|
247
|
+
homeyTier,
|
|
246
248
|
};
|
|
247
249
|
}
|
|
248
250
|
|
|
@@ -290,7 +292,7 @@ class HomeyAPIV3 extends HomeyAPI {
|
|
|
290
292
|
headers,
|
|
291
293
|
body,
|
|
292
294
|
},
|
|
293
|
-
$timeout
|
|
295
|
+
$timeout,
|
|
294
296
|
);
|
|
295
297
|
|
|
296
298
|
const resStatusCode = res.status;
|
|
@@ -341,7 +343,7 @@ class HomeyAPIV3 extends HomeyAPI {
|
|
|
341
343
|
error_description: resBodyJson.error_description,
|
|
342
344
|
stack: resBodyJson.stack,
|
|
343
345
|
},
|
|
344
|
-
resStatusCode
|
|
346
|
+
resStatusCode,
|
|
345
347
|
);
|
|
346
348
|
}
|
|
347
349
|
|
|
@@ -350,7 +352,7 @@ class HomeyAPIV3 extends HomeyAPI {
|
|
|
350
352
|
{
|
|
351
353
|
error: resBodyText,
|
|
352
354
|
},
|
|
353
|
-
resStatusCode
|
|
355
|
+
resStatusCode,
|
|
354
356
|
);
|
|
355
357
|
}
|
|
356
358
|
|
|
@@ -358,7 +360,7 @@ class HomeyAPIV3 extends HomeyAPI {
|
|
|
358
360
|
{
|
|
359
361
|
error: resStatusText,
|
|
360
362
|
},
|
|
361
|
-
resStatusCode
|
|
363
|
+
resStatusCode,
|
|
362
364
|
);
|
|
363
365
|
}
|
|
364
366
|
|
|
@@ -507,19 +509,11 @@ class HomeyAPIV3 extends HomeyAPI {
|
|
|
507
509
|
return this.__socketSession.isConnected();
|
|
508
510
|
}
|
|
509
511
|
|
|
510
|
-
async subscribe(
|
|
511
|
-
uri,
|
|
512
|
-
handlers
|
|
513
|
-
) {
|
|
512
|
+
async subscribe(uri, handlers) {
|
|
514
513
|
return this.__subscriptionRegistry.subscribe(uri, handlers);
|
|
515
514
|
}
|
|
516
515
|
|
|
517
|
-
async __apiRequest({
|
|
518
|
-
uri,
|
|
519
|
-
operation,
|
|
520
|
-
args,
|
|
521
|
-
timeout = this.constructor.DEFAULT_TIMEOUT,
|
|
522
|
-
}) {
|
|
516
|
+
async __apiRequest({ uri, operation, args, timeout = this.constructor.DEFAULT_TIMEOUT }) {
|
|
523
517
|
return this.__socketSession.requestApi({
|
|
524
518
|
uri,
|
|
525
519
|
operation,
|