homey-api 3.4.34 → 3.5.0
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.
|
@@ -1225,6 +1225,9 @@
|
|
|
1225
1225
|
},
|
|
1226
1226
|
"color": {
|
|
1227
1227
|
"type": "string"
|
|
1228
|
+
},
|
|
1229
|
+
"note": {
|
|
1230
|
+
"type": "string"
|
|
1228
1231
|
}
|
|
1229
1232
|
},
|
|
1230
1233
|
"x-realtime-bindings": {
|
|
@@ -2041,6 +2044,9 @@
|
|
|
2041
2044
|
},
|
|
2042
2045
|
"color": {
|
|
2043
2046
|
"type": "string"
|
|
2047
|
+
},
|
|
2048
|
+
"note": {
|
|
2049
|
+
"type": "string"
|
|
2044
2050
|
}
|
|
2045
2051
|
}
|
|
2046
2052
|
}
|
|
@@ -2633,7 +2639,7 @@
|
|
|
2633
2639
|
"uriObj": {
|
|
2634
2640
|
"type": "object"
|
|
2635
2641
|
},
|
|
2636
|
-
"
|
|
2642
|
+
"advanced": {
|
|
2637
2643
|
"type": "boolean"
|
|
2638
2644
|
},
|
|
2639
2645
|
"title": {
|
|
@@ -2714,7 +2720,7 @@
|
|
|
2714
2720
|
"uriObj": {
|
|
2715
2721
|
"type": "object"
|
|
2716
2722
|
},
|
|
2717
|
-
"
|
|
2723
|
+
"advanced": {
|
|
2718
2724
|
"type": "boolean"
|
|
2719
2725
|
},
|
|
2720
2726
|
"title": {
|
|
@@ -2762,7 +2768,7 @@
|
|
|
2762
2768
|
"uriObj": {
|
|
2763
2769
|
"type": "object"
|
|
2764
2770
|
},
|
|
2765
|
-
"
|
|
2771
|
+
"advanced": {
|
|
2766
2772
|
"type": "boolean"
|
|
2767
2773
|
},
|
|
2768
2774
|
"title": {
|
|
@@ -3316,7 +3322,7 @@
|
|
|
3316
3322
|
"path": "/flowcardaction/:uri/:id/run",
|
|
3317
3323
|
"private": false,
|
|
3318
3324
|
"scopes": [
|
|
3319
|
-
"homey.flow
|
|
3325
|
+
"homey.flow"
|
|
3320
3326
|
],
|
|
3321
3327
|
"parameters": {
|
|
3322
3328
|
"id": {
|
|
@@ -3333,6 +3339,10 @@
|
|
|
3333
3339
|
"in": "body",
|
|
3334
3340
|
"type": "number"
|
|
3335
3341
|
},
|
|
3342
|
+
"state": {
|
|
3343
|
+
"in": "body",
|
|
3344
|
+
"type": "object"
|
|
3345
|
+
},
|
|
3336
3346
|
"tokens": {
|
|
3337
3347
|
"in": "body",
|
|
3338
3348
|
"type": "object"
|
|
@@ -3389,7 +3399,7 @@
|
|
|
3389
3399
|
"path": "/flowcardcondition/:uri/:id/run",
|
|
3390
3400
|
"private": false,
|
|
3391
3401
|
"scopes": [
|
|
3392
|
-
"homey.flow
|
|
3402
|
+
"homey.flow"
|
|
3393
3403
|
],
|
|
3394
3404
|
"parameters": {
|
|
3395
3405
|
"id": {
|
|
@@ -3402,6 +3412,10 @@
|
|
|
3402
3412
|
"required": true,
|
|
3403
3413
|
"type": "string"
|
|
3404
3414
|
},
|
|
3415
|
+
"state": {
|
|
3416
|
+
"in": "body",
|
|
3417
|
+
"type": "object"
|
|
3418
|
+
},
|
|
3405
3419
|
"tokens": {
|
|
3406
3420
|
"in": "body",
|
|
3407
3421
|
"type": "object"
|
|
@@ -3835,6 +3849,14 @@
|
|
|
3835
3849
|
"x-homey-readonly": true,
|
|
3836
3850
|
"type": "string"
|
|
3837
3851
|
},
|
|
3852
|
+
"titleTrue": {
|
|
3853
|
+
"x-homey-readonly": true,
|
|
3854
|
+
"type": "string"
|
|
3855
|
+
},
|
|
3856
|
+
"titleFalse": {
|
|
3857
|
+
"x-homey-readonly": true,
|
|
3858
|
+
"type": "string"
|
|
3859
|
+
},
|
|
3838
3860
|
"type": {
|
|
3839
3861
|
"x-homey-readonly": true,
|
|
3840
3862
|
"type": "string",
|
|
@@ -4287,22 +4309,42 @@
|
|
|
4287
4309
|
"name": {
|
|
4288
4310
|
"type": "string"
|
|
4289
4311
|
},
|
|
4290
|
-
"
|
|
4291
|
-
"type":
|
|
4312
|
+
"preset": {
|
|
4313
|
+
"type": [
|
|
4314
|
+
"string",
|
|
4315
|
+
"null"
|
|
4316
|
+
]
|
|
4292
4317
|
},
|
|
4293
|
-
"
|
|
4318
|
+
"zone": {
|
|
4294
4319
|
"type": "string"
|
|
4295
4320
|
},
|
|
4296
4321
|
"devices": {
|
|
4297
|
-
"type": "
|
|
4298
|
-
"
|
|
4299
|
-
|
|
4300
|
-
"
|
|
4301
|
-
"
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4322
|
+
"type": "object",
|
|
4323
|
+
"additionalProperties": false,
|
|
4324
|
+
"patternProperties": {
|
|
4325
|
+
"^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$": {
|
|
4326
|
+
"type": "object",
|
|
4327
|
+
"additionalProperties": false,
|
|
4328
|
+
"properties": {
|
|
4329
|
+
"state": {
|
|
4330
|
+
"type": "object",
|
|
4331
|
+
"additionalProperties": false,
|
|
4332
|
+
"patternProperties": {
|
|
4333
|
+
".*": {
|
|
4334
|
+
"anyOf": [
|
|
4335
|
+
{
|
|
4336
|
+
"type": "string"
|
|
4337
|
+
},
|
|
4338
|
+
{
|
|
4339
|
+
"type": "boolean"
|
|
4340
|
+
},
|
|
4341
|
+
{
|
|
4342
|
+
"type": "number"
|
|
4343
|
+
}
|
|
4344
|
+
]
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
}
|
|
4306
4348
|
}
|
|
4307
4349
|
}
|
|
4308
4350
|
}
|
|
@@ -4318,22 +4360,18 @@
|
|
|
4318
4360
|
}
|
|
4319
4361
|
},
|
|
4320
4362
|
"operations": {
|
|
4321
|
-
"
|
|
4363
|
+
"setMood": {
|
|
4322
4364
|
"method": "POST",
|
|
4323
|
-
"path": "/mood/:id/
|
|
4365
|
+
"path": "/mood/:id/set",
|
|
4324
4366
|
"private": false,
|
|
4325
4367
|
"scopes": [
|
|
4326
|
-
"homey.mood.
|
|
4368
|
+
"homey.mood.set"
|
|
4327
4369
|
],
|
|
4328
4370
|
"parameters": {
|
|
4329
4371
|
"id": {
|
|
4330
4372
|
"in": "path",
|
|
4331
4373
|
"required": true,
|
|
4332
4374
|
"type": "string"
|
|
4333
|
-
},
|
|
4334
|
-
"state": {
|
|
4335
|
-
"in": "body",
|
|
4336
|
-
"root": true
|
|
4337
4375
|
}
|
|
4338
4376
|
}
|
|
4339
4377
|
},
|
|
@@ -4443,76 +4481,37 @@
|
|
|
4443
4481
|
"type": "id",
|
|
4444
4482
|
"schema": {
|
|
4445
4483
|
"type": "object",
|
|
4484
|
+
"additionalProperties": false,
|
|
4446
4485
|
"properties": {
|
|
4447
4486
|
"id": {
|
|
4448
4487
|
"type": "string",
|
|
4449
|
-
"format": "uuid"
|
|
4450
|
-
"x-homey-updateable": false
|
|
4488
|
+
"format": "uuid"
|
|
4451
4489
|
},
|
|
4452
4490
|
"name": {
|
|
4453
4491
|
"type": "string"
|
|
4454
4492
|
},
|
|
4455
|
-
"
|
|
4456
|
-
"type": "
|
|
4457
|
-
"
|
|
4458
|
-
|
|
4459
|
-
"
|
|
4460
|
-
"
|
|
4461
|
-
|
|
4462
|
-
"
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
"
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
"
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
"type": "number"
|
|
4478
|
-
},
|
|
4479
|
-
"height": {
|
|
4480
|
-
"type": "number"
|
|
4481
|
-
},
|
|
4482
|
-
"settings": {
|
|
4483
|
-
"type": "object"
|
|
4484
|
-
}
|
|
4485
|
-
}
|
|
4486
|
-
}
|
|
4487
|
-
}
|
|
4488
|
-
},
|
|
4489
|
-
"lines": {
|
|
4490
|
-
"type": "object",
|
|
4491
|
-
"additionalProperties": false,
|
|
4492
|
-
"patternProperties": {
|
|
4493
|
-
"^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$": {
|
|
4494
|
-
"type": "object",
|
|
4495
|
-
"required": [
|
|
4496
|
-
"x1",
|
|
4497
|
-
"x2",
|
|
4498
|
-
"y1",
|
|
4499
|
-
"y2"
|
|
4500
|
-
],
|
|
4501
|
-
"properties": {
|
|
4502
|
-
"x1": {
|
|
4503
|
-
"type": "number"
|
|
4504
|
-
},
|
|
4505
|
-
"x2": {
|
|
4506
|
-
"type": "number"
|
|
4507
|
-
},
|
|
4508
|
-
"y1": {
|
|
4509
|
-
"type": "number"
|
|
4510
|
-
},
|
|
4511
|
-
"y2": {
|
|
4512
|
-
"type": "number"
|
|
4513
|
-
},
|
|
4514
|
-
"settings": {
|
|
4515
|
-
"type": "object"
|
|
4493
|
+
"columns": {
|
|
4494
|
+
"type": "array",
|
|
4495
|
+
"items": {
|
|
4496
|
+
"type": "object",
|
|
4497
|
+
"properties": {
|
|
4498
|
+
"id": {
|
|
4499
|
+
"type": "string",
|
|
4500
|
+
"format": "uuid"
|
|
4501
|
+
},
|
|
4502
|
+
"widgets": {
|
|
4503
|
+
"type": "array",
|
|
4504
|
+
"items": {
|
|
4505
|
+
"type": "object",
|
|
4506
|
+
"required": [
|
|
4507
|
+
"id"
|
|
4508
|
+
],
|
|
4509
|
+
"properties": {
|
|
4510
|
+
"id": {
|
|
4511
|
+
"type": "string",
|
|
4512
|
+
"format": "uuid"
|
|
4513
|
+
}
|
|
4514
|
+
}
|
|
4516
4515
|
}
|
|
4517
4516
|
}
|
|
4518
4517
|
}
|
|
@@ -357,7 +357,7 @@ export namespace HomeyAPIV2.ManagerFlow {
|
|
|
357
357
|
|
|
358
358
|
uriObj: object;
|
|
359
359
|
|
|
360
|
-
|
|
360
|
+
advanced: boolean;
|
|
361
361
|
|
|
362
362
|
title: string;
|
|
363
363
|
|
|
@@ -388,7 +388,7 @@ export namespace HomeyAPIV2.ManagerFlow {
|
|
|
388
388
|
|
|
389
389
|
uriObj: object;
|
|
390
390
|
|
|
391
|
-
|
|
391
|
+
advanced: boolean;
|
|
392
392
|
|
|
393
393
|
title: string;
|
|
394
394
|
|
|
@@ -417,7 +417,7 @@ export namespace HomeyAPIV2.ManagerFlow {
|
|
|
417
417
|
|
|
418
418
|
uriObj: object;
|
|
419
419
|
|
|
420
|
-
|
|
420
|
+
advanced: boolean;
|
|
421
421
|
|
|
422
422
|
title: string;
|
|
423
423
|
|
|
@@ -483,6 +483,10 @@ export namespace HomeyAPIV2.ManagerInsights {
|
|
|
483
483
|
|
|
484
484
|
title: string;
|
|
485
485
|
|
|
486
|
+
titleTrue: string;
|
|
487
|
+
|
|
488
|
+
titleFalse: string;
|
|
489
|
+
|
|
486
490
|
type: string;
|
|
487
491
|
|
|
488
492
|
units: string;
|
|
@@ -136,6 +136,8 @@ export namespace HomeyAPIV2.ManagerDashboards {
|
|
|
136
136
|
|
|
137
137
|
name: string;
|
|
138
138
|
|
|
139
|
+
columns: Array<any>;
|
|
140
|
+
|
|
139
141
|
widgets: object;
|
|
140
142
|
|
|
141
143
|
lines: object;
|
|
@@ -369,7 +371,7 @@ export namespace HomeyAPIV2.ManagerFlow {
|
|
|
369
371
|
|
|
370
372
|
uriObj: object;
|
|
371
373
|
|
|
372
|
-
|
|
374
|
+
advanced: boolean;
|
|
373
375
|
|
|
374
376
|
title: string;
|
|
375
377
|
|
|
@@ -400,7 +402,7 @@ export namespace HomeyAPIV2.ManagerFlow {
|
|
|
400
402
|
|
|
401
403
|
uriObj: object;
|
|
402
404
|
|
|
403
|
-
|
|
405
|
+
advanced: boolean;
|
|
404
406
|
|
|
405
407
|
title: string;
|
|
406
408
|
|
|
@@ -429,7 +431,7 @@ export namespace HomeyAPIV2.ManagerFlow {
|
|
|
429
431
|
|
|
430
432
|
uriObj: object;
|
|
431
433
|
|
|
432
|
-
|
|
434
|
+
advanced: boolean;
|
|
433
435
|
|
|
434
436
|
title: string;
|
|
435
437
|
|
|
@@ -495,6 +497,10 @@ export namespace HomeyAPIV2.ManagerInsights {
|
|
|
495
497
|
|
|
496
498
|
title: string;
|
|
497
499
|
|
|
500
|
+
titleTrue: string;
|
|
501
|
+
|
|
502
|
+
titleFalse: string;
|
|
503
|
+
|
|
498
504
|
type: string;
|
|
499
505
|
|
|
500
506
|
units: string;
|
|
@@ -525,11 +531,11 @@ export namespace HomeyAPIV2.ManagerMoods {
|
|
|
525
531
|
|
|
526
532
|
name: string;
|
|
527
533
|
|
|
528
|
-
|
|
534
|
+
preset: string | null;
|
|
529
535
|
|
|
530
|
-
|
|
536
|
+
zone: string;
|
|
531
537
|
|
|
532
|
-
devices:
|
|
538
|
+
devices: object;
|
|
533
539
|
}
|
|
534
540
|
}
|
|
535
541
|
|
package/lib/AthomCloudAPI.js
CHANGED
|
@@ -543,6 +543,63 @@ for(const {@link HomeyAPIV2.ManagerDevices.Device device} of Object.values(devic
|
|
|
543
543
|
return this.__token;
|
|
544
544
|
}
|
|
545
545
|
|
|
546
|
+
async authenticateWithExtendedGrantType(grantType, grantParams) {
|
|
547
|
+
if (!grantParams) {
|
|
548
|
+
throw new Error('Missing Params');
|
|
549
|
+
}
|
|
550
|
+
if (!grantType) {
|
|
551
|
+
throw new Error('Missing Grant Type');
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
if (!this.__clientId) {
|
|
555
|
+
throw new Error('Missing Client ID');
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
if (!this.__clientSecret) {
|
|
559
|
+
throw new Error('Missing Client Secret');
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
const params = {
|
|
563
|
+
grant_type: grantType,
|
|
564
|
+
...grantParams,
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
const response = await Util.fetch(`${this.baseUrl}/oauth2/token`, {
|
|
568
|
+
body: Util.encodeUrlSearchParams(params),
|
|
569
|
+
method: 'post',
|
|
570
|
+
headers: {
|
|
571
|
+
Authorization: `Basic ${Util.base64(`${this.__clientId}:${this.__clientSecret}`)}`,
|
|
572
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
573
|
+
},
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
let responseBody;
|
|
577
|
+
try {
|
|
578
|
+
responseBody = await response.json();
|
|
579
|
+
} catch (err) {
|
|
580
|
+
this.__debug(`Invalid response from server (${response.status}): ${response.text()}`);
|
|
581
|
+
throw new APIError(`Invalid response from server: ${response.text()}`, response.status);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
if (!response.ok) {
|
|
585
|
+
throw new APIError(responseBody.error_description || responseBody.error, response.status);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
this.__token = new Token({
|
|
589
|
+
token_type: responseBody.token_type,
|
|
590
|
+
access_token: responseBody.access_token,
|
|
591
|
+
refresh_token: responseBody.refresh_token,
|
|
592
|
+
expires_in: responseBody.expires_in,
|
|
593
|
+
grant_type: grantType,
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
this.__setStore({
|
|
597
|
+
token: this.__token,
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
return this.__token;
|
|
601
|
+
}
|
|
602
|
+
|
|
546
603
|
async authenticateWithRefreshToken() {
|
|
547
604
|
if (!this.__refreshTokenPromise) {
|
|
548
605
|
this.__refreshTokenPromise = Promise.resolve().then(async () => {
|