homey-api 3.12.4 → 3.13.1
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.
- package/assets/specifications/HomeyAPIV3Local.json +160 -0
- package/assets/types/homey-api.private.d.ts +46 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerApps/App.js +15 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerApps.js +13 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerFlow/AdvancedFlow.js +8 -2
- package/lib/HomeyAPI/HomeyAPIV2.js +2 -2
- package/package.json +1 -1
|
@@ -627,6 +627,103 @@
|
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
},
|
|
630
|
+
"ManagerCameras": {
|
|
631
|
+
"id": "cameras",
|
|
632
|
+
"idCamelCase": "cameras",
|
|
633
|
+
"private": true,
|
|
634
|
+
"items": {
|
|
635
|
+
"Camera": {
|
|
636
|
+
"id": "camera",
|
|
637
|
+
"schema": {
|
|
638
|
+
"type": "object",
|
|
639
|
+
"properties": {
|
|
640
|
+
"id": {
|
|
641
|
+
"type": "string"
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
"operations": {
|
|
648
|
+
"getState": {
|
|
649
|
+
"method": "get",
|
|
650
|
+
"path": "/state",
|
|
651
|
+
"private": false,
|
|
652
|
+
"scopes": [
|
|
653
|
+
"homey.system.readonly"
|
|
654
|
+
],
|
|
655
|
+
"parameters": {}
|
|
656
|
+
},
|
|
657
|
+
"getCameras": {
|
|
658
|
+
"method": "get",
|
|
659
|
+
"path": "/camera",
|
|
660
|
+
"private": false,
|
|
661
|
+
"scopes": [
|
|
662
|
+
"homey.device.readonly"
|
|
663
|
+
],
|
|
664
|
+
"crud": {
|
|
665
|
+
"type": "getAll",
|
|
666
|
+
"item": "Camera"
|
|
667
|
+
},
|
|
668
|
+
"parameters": {}
|
|
669
|
+
},
|
|
670
|
+
"offer": {
|
|
671
|
+
"method": "post",
|
|
672
|
+
"path": "/:id/offer",
|
|
673
|
+
"private": false,
|
|
674
|
+
"scopes": [
|
|
675
|
+
"homey.device.readonly"
|
|
676
|
+
],
|
|
677
|
+
"parameters": {
|
|
678
|
+
"id": {
|
|
679
|
+
"in": "path",
|
|
680
|
+
"type": "string",
|
|
681
|
+
"required": true
|
|
682
|
+
},
|
|
683
|
+
"offer": {
|
|
684
|
+
"in": "body",
|
|
685
|
+
"type": "string",
|
|
686
|
+
"required": true
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
"keepAlive": {
|
|
691
|
+
"method": "post",
|
|
692
|
+
"path": "/:id/keep-alive",
|
|
693
|
+
"private": false,
|
|
694
|
+
"scopes": [
|
|
695
|
+
"homey.device.readonly"
|
|
696
|
+
],
|
|
697
|
+
"parameters": {
|
|
698
|
+
"id": {
|
|
699
|
+
"in": "path",
|
|
700
|
+
"type": "string",
|
|
701
|
+
"required": true
|
|
702
|
+
},
|
|
703
|
+
"streamId": {
|
|
704
|
+
"in": "body",
|
|
705
|
+
"type": "string",
|
|
706
|
+
"required": true
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
"videoUrl": {
|
|
711
|
+
"method": "get",
|
|
712
|
+
"path": "/:id/video-url",
|
|
713
|
+
"private": false,
|
|
714
|
+
"scopes": [
|
|
715
|
+
"homey.device.readonly"
|
|
716
|
+
],
|
|
717
|
+
"parameters": {
|
|
718
|
+
"id": {
|
|
719
|
+
"in": "path",
|
|
720
|
+
"type": "string",
|
|
721
|
+
"required": true
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
},
|
|
630
727
|
"ManagerClock": {
|
|
631
728
|
"id": "clock",
|
|
632
729
|
"idCamelCase": "clock",
|
|
@@ -6362,6 +6459,45 @@
|
|
|
6362
6459
|
}
|
|
6363
6460
|
}
|
|
6364
6461
|
},
|
|
6462
|
+
"getFirmwareVersion": {
|
|
6463
|
+
"method": "get",
|
|
6464
|
+
"path": "/firmware-version",
|
|
6465
|
+
"private": true,
|
|
6466
|
+
"scopes": [
|
|
6467
|
+
"homey.system"
|
|
6468
|
+
],
|
|
6469
|
+
"parameters": {}
|
|
6470
|
+
},
|
|
6471
|
+
"flashFirmware": {
|
|
6472
|
+
"method": "put",
|
|
6473
|
+
"path": "/flash-firmware",
|
|
6474
|
+
"private": true,
|
|
6475
|
+
"scopes": [
|
|
6476
|
+
"homey.system"
|
|
6477
|
+
],
|
|
6478
|
+
"parameters": {
|
|
6479
|
+
"erase": {
|
|
6480
|
+
"in": "body",
|
|
6481
|
+
"type": "string"
|
|
6482
|
+
},
|
|
6483
|
+
"downgrade": {
|
|
6484
|
+
"in": "body",
|
|
6485
|
+
"type": "string"
|
|
6486
|
+
},
|
|
6487
|
+
"version": {
|
|
6488
|
+
"in": "body",
|
|
6489
|
+
"type": "string"
|
|
6490
|
+
},
|
|
6491
|
+
"firmware": {
|
|
6492
|
+
"in": "body",
|
|
6493
|
+
"type": "string"
|
|
6494
|
+
},
|
|
6495
|
+
"shasum": {
|
|
6496
|
+
"in": "body",
|
|
6497
|
+
"type": "string"
|
|
6498
|
+
}
|
|
6499
|
+
}
|
|
6500
|
+
},
|
|
6365
6501
|
"getLog": {
|
|
6366
6502
|
"method": "get",
|
|
6367
6503
|
"path": "/log",
|
|
@@ -6385,6 +6521,30 @@
|
|
|
6385
6521
|
"required": true
|
|
6386
6522
|
}
|
|
6387
6523
|
}
|
|
6524
|
+
},
|
|
6525
|
+
"setLBTThreshold": {
|
|
6526
|
+
"method": "put",
|
|
6527
|
+
"path": "/lbt-threshold",
|
|
6528
|
+
"private": true,
|
|
6529
|
+
"scopes": [
|
|
6530
|
+
"homey.system"
|
|
6531
|
+
],
|
|
6532
|
+
"parameters": {
|
|
6533
|
+
"threshold": {
|
|
6534
|
+
"in": "body",
|
|
6535
|
+
"type": "number",
|
|
6536
|
+
"required": true
|
|
6537
|
+
}
|
|
6538
|
+
}
|
|
6539
|
+
},
|
|
6540
|
+
"attemptNvmFix": {
|
|
6541
|
+
"method": "put",
|
|
6542
|
+
"path": "/attempt-nvm-fix",
|
|
6543
|
+
"private": true,
|
|
6544
|
+
"scopes": [
|
|
6545
|
+
"homey.system"
|
|
6546
|
+
],
|
|
6547
|
+
"parameters": {}
|
|
6388
6548
|
}
|
|
6389
6549
|
}
|
|
6390
6550
|
}
|
|
@@ -1166,6 +1166,12 @@ export namespace HomeyAPIV3Local.ManagerApps {
|
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
1168
|
|
|
1169
|
+
export namespace HomeyAPIV3Local.ManagerCameras {
|
|
1170
|
+
export class Camera {
|
|
1171
|
+
id: string;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1169
1175
|
export namespace HomeyAPIV3Local.ManagerCloud {
|
|
1170
1176
|
export class Webhook {
|
|
1171
1177
|
id: string;
|
|
@@ -10622,6 +10628,28 @@ export namespace HomeyAPIV3Local {
|
|
|
10622
10628
|
}): Promise<any>;
|
|
10623
10629
|
}
|
|
10624
10630
|
|
|
10631
|
+
export class ManagerCameras extends HomeyAPIV3.ManagerCameras {
|
|
10632
|
+
getState(): Promise<any>;
|
|
10633
|
+
|
|
10634
|
+
getCameras(): Promise<{
|
|
10635
|
+
[key: string]: HomeyAPIV3Local.ManagerCameras.Camera;
|
|
10636
|
+
}>;
|
|
10637
|
+
|
|
10638
|
+
offer(opts: {
|
|
10639
|
+
id: string;
|
|
10640
|
+
|
|
10641
|
+
offer: string;
|
|
10642
|
+
}): Promise<any>;
|
|
10643
|
+
|
|
10644
|
+
keepAlive(opts: {
|
|
10645
|
+
id: string;
|
|
10646
|
+
|
|
10647
|
+
streamId: string;
|
|
10648
|
+
}): Promise<any>;
|
|
10649
|
+
|
|
10650
|
+
videoUrl(opts: { id: string }): Promise<any>;
|
|
10651
|
+
}
|
|
10652
|
+
|
|
10625
10653
|
export class ManagerClock extends HomeyAPIV3.ManagerClock {
|
|
10626
10654
|
getState(): Promise<any>;
|
|
10627
10655
|
}
|
|
@@ -11941,9 +11969,27 @@ export namespace HomeyAPIV3Local {
|
|
|
11941
11969
|
opts?: object;
|
|
11942
11970
|
}): Promise<any>;
|
|
11943
11971
|
|
|
11972
|
+
getFirmwareVersion(): Promise<any>;
|
|
11973
|
+
|
|
11974
|
+
flashFirmware(opts: {
|
|
11975
|
+
erase?: string;
|
|
11976
|
+
|
|
11977
|
+
downgrade?: string;
|
|
11978
|
+
|
|
11979
|
+
version?: string;
|
|
11980
|
+
|
|
11981
|
+
firmware?: string;
|
|
11982
|
+
|
|
11983
|
+
shasum?: string;
|
|
11984
|
+
}): Promise<any>;
|
|
11985
|
+
|
|
11944
11986
|
getLog(): Promise<any>;
|
|
11945
11987
|
|
|
11946
11988
|
setLogEnabled(opts: { enabled: boolean }): Promise<any>;
|
|
11989
|
+
|
|
11990
|
+
setLBTThreshold(opts: { threshold: number }): Promise<any>;
|
|
11991
|
+
|
|
11992
|
+
attemptNvmFix(): Promise<any>;
|
|
11947
11993
|
}
|
|
11948
11994
|
}
|
|
11949
11995
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const AppV3 = require('../../HomeyAPIV3/ManagerApps/App');
|
|
4
|
+
|
|
5
|
+
class App extends AppV3 {
|
|
6
|
+
static transformGet(item) {
|
|
7
|
+
item = super.transformGet(item);
|
|
8
|
+
item.color = item.brandColor;
|
|
9
|
+
delete item.brandColor;
|
|
10
|
+
|
|
11
|
+
return item;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = App;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ManagerAppsV3 = require('../HomeyAPIV3/ManagerApps');
|
|
4
|
+
const App = require('./ManagerApps/App');
|
|
5
|
+
|
|
6
|
+
class ManagerApps extends ManagerAppsV3 {
|
|
7
|
+
static CRUD = {
|
|
8
|
+
...super.CRUD,
|
|
9
|
+
App,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = ManagerApps;
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
const AdvancedFlowV3 = require('../../HomeyAPIV3/ManagerFlow/AdvancedFlow');
|
|
4
4
|
|
|
5
5
|
class AdvancedFlow extends AdvancedFlowV3 {
|
|
6
|
-
|
|
7
6
|
static transformGet(item) {
|
|
8
7
|
if (item.cards) {
|
|
9
8
|
for (const card of Object.values(item.cards)) {
|
|
9
|
+
if (card.type !== 'trigger' && card.type !== 'condition' && card.type !== 'action') {
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
|
|
10
13
|
card.id = `${card.ownerUri}:${card.id}`;
|
|
11
14
|
}
|
|
12
15
|
}
|
|
@@ -19,6 +22,10 @@ class AdvancedFlow extends AdvancedFlowV3 {
|
|
|
19
22
|
static transformSet(item) {
|
|
20
23
|
if (item.cards) {
|
|
21
24
|
for (const card of Object.values(item.cards)) {
|
|
25
|
+
if (card.type !== 'trigger' && card.type !== 'condition' && card.type !== 'action') {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
|
|
22
29
|
card.ownerUri = card.id.split(':', 3).join(':');
|
|
23
30
|
card.id = card.id.split(':').reverse()[0];
|
|
24
31
|
}
|
|
@@ -26,7 +33,6 @@ class AdvancedFlow extends AdvancedFlowV3 {
|
|
|
26
33
|
|
|
27
34
|
return item;
|
|
28
35
|
}
|
|
29
|
-
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
module.exports = AdvancedFlow;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const HomeyAPIV3 = require('./HomeyAPIV3');
|
|
4
4
|
const ManagerFlow = require('./HomeyAPIV2/ManagerFlow');
|
|
5
5
|
const ManagerFlowToken = require('./HomeyAPIV2/ManagerFlowToken');
|
|
6
|
+
const ManagerApps = require('./HomeyAPIV2/ManagerApps');
|
|
6
7
|
const ManagerDevices = require('./HomeyAPIV2/ManagerDevices');
|
|
7
8
|
const ManagerDrivers = require('./HomeyAPIV2/ManagerDrivers');
|
|
8
9
|
const ManagerDevkit = require('./HomeyAPIV2/ManagerDevkit');
|
|
@@ -16,7 +17,6 @@ const ManagerInsights = require('./HomeyAPIV2/ManagerInsights');
|
|
|
16
17
|
* @extends HomeyAPIV3
|
|
17
18
|
*/
|
|
18
19
|
class HomeyAPIV2 extends HomeyAPIV3 {
|
|
19
|
-
|
|
20
20
|
static DEFAULT_TIMEOUT = 1000 * 30;
|
|
21
21
|
|
|
22
22
|
static MANAGERS = {
|
|
@@ -27,6 +27,7 @@ class HomeyAPIV2 extends HomeyAPIV3 {
|
|
|
27
27
|
ManagerDrivers,
|
|
28
28
|
ManagerDevkit,
|
|
29
29
|
ManagerInsights,
|
|
30
|
+
ManagerApps,
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
get platform() {
|
|
@@ -36,7 +37,6 @@ class HomeyAPIV2 extends HomeyAPIV3 {
|
|
|
36
37
|
get platformVersion() {
|
|
37
38
|
return 1;
|
|
38
39
|
}
|
|
39
|
-
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
module.exports = HomeyAPIV2;
|