homey-api 3.0.11 → 3.0.13

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.
@@ -178,7 +178,6 @@
178
178
  },
179
179
  "value": {
180
180
  "in": "body",
181
- "type": "object",
182
181
  "required": true
183
182
  }
184
183
  }
@@ -1091,8 +1090,7 @@
1091
1090
  "required": true
1092
1091
  },
1093
1092
  "data": {
1094
- "in": "body",
1095
- "type": "object"
1093
+ "in": "body"
1096
1094
  }
1097
1095
  }
1098
1096
  },
@@ -1115,8 +1113,7 @@
1115
1113
  "required": true
1116
1114
  },
1117
1115
  "data": {
1118
- "in": "body",
1119
- "type": "object"
1116
+ "in": "body"
1120
1117
  }
1121
1118
  }
1122
1119
  },
@@ -1618,6 +1615,30 @@
1618
1615
  }
1619
1616
  }
1620
1617
  },
1618
+ "getFlowCardTrigger": {
1619
+ "method": "get",
1620
+ "path": "/flowcardtrigger/:uri/:id",
1621
+ "private": false,
1622
+ "scopes": [
1623
+ "homey.flow.readonly"
1624
+ ],
1625
+ "crud": {
1626
+ "type": "getOne",
1627
+ "item": "FlowCardTrigger"
1628
+ },
1629
+ "parameters": {
1630
+ "id": {
1631
+ "in": "path",
1632
+ "type": "string",
1633
+ "required": true
1634
+ },
1635
+ "uri": {
1636
+ "in": "path",
1637
+ "type": "string",
1638
+ "required": true
1639
+ }
1640
+ }
1641
+ },
1621
1642
  "getFlowCardTriggers": {
1622
1643
  "method": "get",
1623
1644
  "path": "/flowcardtrigger",
@@ -1631,6 +1652,30 @@
1631
1652
  },
1632
1653
  "parameters": {}
1633
1654
  },
1655
+ "getFlowCardCondition": {
1656
+ "method": "get",
1657
+ "path": "/flowcardcondition/:uri/:id",
1658
+ "private": false,
1659
+ "scopes": [
1660
+ "homey.flow.readonly"
1661
+ ],
1662
+ "crud": {
1663
+ "type": "getOne",
1664
+ "item": "FlowCardCondition"
1665
+ },
1666
+ "parameters": {
1667
+ "id": {
1668
+ "in": "path",
1669
+ "type": "string",
1670
+ "required": true
1671
+ },
1672
+ "uri": {
1673
+ "in": "path",
1674
+ "type": "string",
1675
+ "required": true
1676
+ }
1677
+ }
1678
+ },
1634
1679
  "getFlowCardConditions": {
1635
1680
  "method": "get",
1636
1681
  "path": "/flowcardcondition",
@@ -1649,7 +1694,7 @@
1649
1694
  "path": "/flowcardcondition/:uri/:id/run",
1650
1695
  "private": false,
1651
1696
  "scopes": [
1652
- "homey.flow.start"
1697
+ "homey.flow"
1653
1698
  ],
1654
1699
  "parameters": {
1655
1700
  "id": {
@@ -1680,6 +1725,30 @@
1680
1725
  }
1681
1726
  }
1682
1727
  },
1728
+ "getFlowCardAction": {
1729
+ "method": "get",
1730
+ "path": "/flowcardaction/:uri/:id",
1731
+ "private": false,
1732
+ "scopes": [
1733
+ "homey.flow.readonly"
1734
+ ],
1735
+ "crud": {
1736
+ "type": "getOne",
1737
+ "item": "FlowCardAction"
1738
+ },
1739
+ "parameters": {
1740
+ "id": {
1741
+ "in": "path",
1742
+ "type": "string",
1743
+ "required": true
1744
+ },
1745
+ "uri": {
1746
+ "in": "path",
1747
+ "type": "string",
1748
+ "required": true
1749
+ }
1750
+ }
1751
+ },
1683
1752
  "getFlowCardActions": {
1684
1753
  "method": "get",
1685
1754
  "path": "/flowcardaction",
@@ -1698,7 +1767,7 @@
1698
1767
  "path": "/flowcardaction/:uri/:id/run",
1699
1768
  "private": false,
1700
1769
  "scopes": [
1701
- "homey.flow.start"
1770
+ "homey.flow"
1702
1771
  ],
1703
1772
  "parameters": {
1704
1773
  "id": {
@@ -1919,6 +1988,40 @@
1919
1988
  "item": "FlowToken"
1920
1989
  },
1921
1990
  "parameters": {}
1991
+ },
1992
+ "getFlowToken": {
1993
+ "method": "get",
1994
+ "path": "/flowtoken/:id",
1995
+ "private": false,
1996
+ "scopes": [
1997
+ "homey.flow.readonly"
1998
+ ],
1999
+ "crud": {
2000
+ "type": "getOne",
2001
+ "item": "FlowToken"
2002
+ },
2003
+ "parameters": {
2004
+ "id": {
2005
+ "in": "path",
2006
+ "type": "string",
2007
+ "required": true
2008
+ }
2009
+ }
2010
+ },
2011
+ "getFlowTokenValue": {
2012
+ "method": "get",
2013
+ "path": "/flowtoken/:id/value",
2014
+ "private": false,
2015
+ "scopes": [
2016
+ "homey.flow.readonly"
2017
+ ],
2018
+ "parameters": {
2019
+ "id": {
2020
+ "in": "path",
2021
+ "type": "string",
2022
+ "required": true
2023
+ }
2024
+ }
1922
2025
  }
1923
2026
  }
1924
2027
  },
@@ -1981,33 +2084,6 @@
1981
2084
  "homey.geolocation"
1982
2085
  ]
1983
2086
  },
1984
- "getOptionMode": {
1985
- "method": "GET",
1986
- "path": "/option/mode",
1987
- "scopes": [
1988
- "homey.geolocation.readonly"
1989
- ]
1990
- },
1991
- "setOptionMode": {
1992
- "method": "PUT",
1993
- "path": "/option/mode",
1994
- "scopes": [
1995
- "homey.geolocation"
1996
- ],
1997
- "parameters": {
1998
- "value": {
1999
- "in": "body",
2000
- "required": true
2001
- }
2002
- }
2003
- },
2004
- "unsetOptionMode": {
2005
- "method": "DELETE",
2006
- "path": "/option/mode",
2007
- "scopes": [
2008
- "homey.geolocation"
2009
- ]
2010
- },
2011
2087
  "getState": {
2012
2088
  "method": "get",
2013
2089
  "path": "/state",
@@ -2340,6 +2416,25 @@
2340
2416
  ],
2341
2417
  "parameters": {}
2342
2418
  },
2419
+ "getVariable": {
2420
+ "method": "get",
2421
+ "path": "/variable/:id",
2422
+ "private": false,
2423
+ "scopes": [
2424
+ "homey.logic.readonly"
2425
+ ],
2426
+ "crud": {
2427
+ "type": "getOne",
2428
+ "item": "Variable"
2429
+ },
2430
+ "parameters": {
2431
+ "id": {
2432
+ "in": "path",
2433
+ "type": "string",
2434
+ "required": true
2435
+ }
2436
+ }
2437
+ },
2343
2438
  "getVariables": {
2344
2439
  "method": "get",
2345
2440
  "path": "/variable",
@@ -2698,6 +2793,21 @@
2698
2793
  }
2699
2794
  }
2700
2795
  },
2796
+ "getPresent": {
2797
+ "method": "get",
2798
+ "path": "/:id/present",
2799
+ "private": false,
2800
+ "scopes": [
2801
+ "homey.presence.readonly"
2802
+ ],
2803
+ "parameters": {
2804
+ "id": {
2805
+ "in": "path",
2806
+ "type": "string",
2807
+ "required": true
2808
+ }
2809
+ }
2810
+ },
2701
2811
  "setAsleepMe": {
2702
2812
  "method": "put",
2703
2813
  "path": "/me/asleep",
@@ -2739,6 +2849,21 @@
2739
2849
  "type": "boolean"
2740
2850
  }
2741
2851
  }
2852
+ },
2853
+ "getAsleep": {
2854
+ "method": "get",
2855
+ "path": "/:id/asleep",
2856
+ "private": false,
2857
+ "scopes": [
2858
+ "homey.presence.readonly"
2859
+ ],
2860
+ "parameters": {
2861
+ "id": {
2862
+ "in": "path",
2863
+ "type": "string",
2864
+ "required": true
2865
+ }
2866
+ }
2742
2867
  }
2743
2868
  }
2744
2869
  },
@@ -2935,7 +3060,8 @@
2935
3060
  "type": "string",
2936
3061
  "enum": [
2937
3062
  "OAUTH",
2938
- "APP"
3063
+ "APP",
3064
+ "PAT"
2939
3065
  ]
2940
3066
  },
2941
3067
  "scopes": {
@@ -3525,13 +3651,34 @@
3525
3651
  "method": "get",
3526
3652
  "path": "/zone",
3527
3653
  "private": false,
3528
- "scopes": [],
3654
+ "scopes": [
3655
+ "homey.zone.readonly"
3656
+ ],
3529
3657
  "crud": {
3530
3658
  "type": "getAll",
3531
3659
  "item": "Zone"
3532
3660
  },
3533
3661
  "parameters": {}
3534
3662
  },
3663
+ "getZone": {
3664
+ "method": "get",
3665
+ "path": "/zone/:id",
3666
+ "private": false,
3667
+ "scopes": [
3668
+ "homey.zone.readonly"
3669
+ ],
3670
+ "crud": {
3671
+ "type": "getOne",
3672
+ "item": "Zone"
3673
+ },
3674
+ "parameters": {
3675
+ "id": {
3676
+ "in": "path",
3677
+ "type": "string",
3678
+ "required": true
3679
+ }
3680
+ }
3681
+ },
3535
3682
  "createZone": {
3536
3683
  "method": "post",
3537
3684
  "path": "/zone",
@@ -3690,6 +3837,48 @@
3690
3837
  "type": "object"
3691
3838
  }
3692
3839
  }
3840
+ },
3841
+ "verifyFirmware": {
3842
+ "method": "get",
3843
+ "path": "/verify-firmware",
3844
+ "private": true,
3845
+ "scopes": [
3846
+ "homey.system"
3847
+ ],
3848
+ "parameters": {}
3849
+ },
3850
+ "flashFirmware": {
3851
+ "method": "put",
3852
+ "path": "/flash-firmware",
3853
+ "private": true,
3854
+ "scopes": [
3855
+ "homey.system"
3856
+ ],
3857
+ "parameters": {
3858
+ "keepNV": {
3859
+ "in": "body",
3860
+ "type": "boolean",
3861
+ "required": true
3862
+ }
3863
+ }
3864
+ },
3865
+ "getLastFlashResult": {
3866
+ "method": "get",
3867
+ "path": "/get-last-flash-result",
3868
+ "private": true,
3869
+ "scopes": [
3870
+ "homey.system"
3871
+ ],
3872
+ "parameters": {}
3873
+ },
3874
+ "eraseNV": {
3875
+ "method": "put",
3876
+ "path": "/erase-nv",
3877
+ "private": true,
3878
+ "scopes": [
3879
+ "homey.system"
3880
+ ],
3881
+ "parameters": {}
3693
3882
  }
3694
3883
  }
3695
3884
  }
@@ -1704,16 +1704,20 @@
1704
1704
  "method": "get",
1705
1705
  "path": "/experiment",
1706
1706
  "private": false,
1707
- "scopes": [],
1707
+ "scopes": [
1708
+ "homey.system"
1709
+ ],
1708
1710
  "parameters": {}
1709
1711
  },
1710
1712
  "enableExperiment": {
1711
1713
  "method": "put",
1712
- "path": "/experiment/:experimentId/enable",
1714
+ "path": "/experiment/:id/enable",
1713
1715
  "private": false,
1714
- "scopes": [],
1716
+ "scopes": [
1717
+ "homey.system"
1718
+ ],
1715
1719
  "parameters": {
1716
- "experimentId": {
1720
+ "id": {
1717
1721
  "in": "path",
1718
1722
  "type": "string",
1719
1723
  "required": true
@@ -1722,11 +1726,13 @@
1722
1726
  },
1723
1727
  "disableExperiment": {
1724
1728
  "method": "put",
1725
- "path": "/experiment/:experimentId/disable",
1729
+ "path": "/experiment/:id/disable",
1726
1730
  "private": false,
1727
- "scopes": [],
1731
+ "scopes": [
1732
+ "homey.system"
1733
+ ],
1728
1734
  "parameters": {
1729
- "experimentId": {
1735
+ "id": {
1730
1736
  "in": "path",
1731
1737
  "type": "string",
1732
1738
  "required": true
@@ -3166,6 +3172,33 @@
3166
3172
  "idCamelCase": "matter",
3167
3173
  "items": {},
3168
3174
  "operations": {
3175
+ "getOptionPaaSettings": {
3176
+ "method": "GET",
3177
+ "path": "/option/paaSettings",
3178
+ "scopes": [
3179
+ "homey.system"
3180
+ ]
3181
+ },
3182
+ "setOptionPaaSettings": {
3183
+ "method": "PUT",
3184
+ "path": "/option/paaSettings",
3185
+ "scopes": [
3186
+ "homey.system"
3187
+ ],
3188
+ "parameters": {
3189
+ "value": {
3190
+ "in": "body",
3191
+ "required": true
3192
+ }
3193
+ }
3194
+ },
3195
+ "unsetOptionPaaSettings": {
3196
+ "method": "DELETE",
3197
+ "path": "/option/paaSettings",
3198
+ "scopes": [
3199
+ "homey.system"
3200
+ ]
3201
+ },
3169
3202
  "getState": {
3170
3203
  "method": "get",
3171
3204
  "path": "/state",
@@ -3174,6 +3207,79 @@
3174
3207
  "homey.system.readonly"
3175
3208
  ],
3176
3209
  "parameters": {}
3210
+ },
3211
+ "pairApi": {
3212
+ "method": "post",
3213
+ "path": "/pair",
3214
+ "private": true,
3215
+ "scopes": [
3216
+ "homey.system"
3217
+ ],
3218
+ "parameters": {
3219
+ "code": {
3220
+ "in": "body",
3221
+ "type": "string",
3222
+ "required": true
3223
+ },
3224
+ "zone": {
3225
+ "in": "body",
3226
+ "type": "string"
3227
+ }
3228
+ }
3229
+ },
3230
+ "updateDCLPaaCerts": {
3231
+ "method": "get",
3232
+ "path": "/update-dcl-paa-certs",
3233
+ "private": true,
3234
+ "scopes": [
3235
+ "homey.system"
3236
+ ],
3237
+ "parameters": {}
3238
+ },
3239
+ "interview": {
3240
+ "method": "get",
3241
+ "path": "/interview",
3242
+ "private": true,
3243
+ "scopes": [
3244
+ "homey.system"
3245
+ ],
3246
+ "parameters": {
3247
+ "nodeId": {
3248
+ "in": "query",
3249
+ "type": "string",
3250
+ "required": true
3251
+ }
3252
+ }
3253
+ },
3254
+ "makeDeviceApi": {
3255
+ "method": "get",
3256
+ "path": "/make-device",
3257
+ "private": true,
3258
+ "scopes": [
3259
+ "homey.system"
3260
+ ],
3261
+ "parameters": {
3262
+ "nodeId": {
3263
+ "in": "query",
3264
+ "type": "string",
3265
+ "required": true
3266
+ }
3267
+ }
3268
+ },
3269
+ "readBasicInformation": {
3270
+ "method": "get",
3271
+ "path": "/read-basic-info",
3272
+ "private": true,
3273
+ "scopes": [
3274
+ "homey.system"
3275
+ ],
3276
+ "parameters": {
3277
+ "nodeId": {
3278
+ "in": "query",
3279
+ "type": "string",
3280
+ "required": true
3281
+ }
3282
+ }
3177
3283
  }
3178
3284
  }
3179
3285
  },
@@ -3853,6 +3959,24 @@
3853
3959
  "required": true
3854
3960
  }
3855
3961
  }
3962
+ },
3963
+ "enableWifi": {
3964
+ "method": "post",
3965
+ "path": "/enable-wifi",
3966
+ "private": false,
3967
+ "scopes": [
3968
+ "homey.system"
3969
+ ],
3970
+ "parameters": {}
3971
+ },
3972
+ "disableWifi": {
3973
+ "method": "post",
3974
+ "path": "/disable-wifi",
3975
+ "private": false,
3976
+ "scopes": [
3977
+ "homey.system"
3978
+ ],
3979
+ "parameters": {}
3856
3980
  }
3857
3981
  }
3858
3982
  },
@@ -4424,6 +4548,28 @@
4424
4548
  }
4425
4549
  }
4426
4550
  }
4551
+ },
4552
+ "VirtualDriverMatter": {
4553
+ "id": "virtualdrivermatter",
4554
+ "schema": {
4555
+ "type": "object",
4556
+ "properties": {
4557
+ "id": {
4558
+ "type": "string"
4559
+ }
4560
+ }
4561
+ }
4562
+ },
4563
+ "VirtualDeviceMatter": {
4564
+ "id": "virtualdevicematter",
4565
+ "schema": {
4566
+ "type": "object",
4567
+ "properties": {
4568
+ "id": {
4569
+ "type": "string"
4570
+ }
4571
+ }
4572
+ }
4427
4573
  }
4428
4574
  },
4429
4575
  "operations": {
@@ -4737,6 +4883,21 @@
4737
4883
  "required": true
4738
4884
  }
4739
4885
  }
4886
+ },
4887
+ "setLBTThreshold": {
4888
+ "method": "put",
4889
+ "path": "/lbt-threshold",
4890
+ "private": true,
4891
+ "scopes": [
4892
+ "homey.system"
4893
+ ],
4894
+ "parameters": {
4895
+ "threshold": {
4896
+ "in": "body",
4897
+ "type": "number",
4898
+ "required": true
4899
+ }
4900
+ }
4740
4901
  }
4741
4902
  }
4742
4903
  }
@@ -1359,6 +1359,10 @@ export namespace HomeyAPIV3Local.ManagerVirtualDevice {
1359
1359
  id: string;
1360
1360
  }
1361
1361
 
1362
+ export class VirtualDeviceMatter {
1363
+ id: string;
1364
+ }
1365
+
1362
1366
  export class VirtualDeviceVirtualButton {
1363
1367
  id: string;
1364
1368
  }
@@ -1391,6 +1395,10 @@ export namespace HomeyAPIV3Local.ManagerVirtualDevice {
1391
1395
  id: string;
1392
1396
  }
1393
1397
 
1398
+ export class VirtualDriverMatter {
1399
+ id: string;
1400
+ }
1401
+
1394
1402
  export class VirtualDriverVirtualButton {
1395
1403
  id: string;
1396
1404
  }
@@ -1783,7 +1791,7 @@ export namespace HomeyAPIV3Cloud {
1783
1791
 
1784
1792
  id: string;
1785
1793
 
1786
- value: object;
1794
+ value: any;
1787
1795
  }): Promise<any>;
1788
1796
 
1789
1797
  unsetAppSetting(opts: {
@@ -1955,7 +1963,7 @@ export namespace HomeyAPIV3Cloud {
1955
1963
 
1956
1964
  event: string;
1957
1965
 
1958
- data?: object;
1966
+ data?: any;
1959
1967
  }): Promise<any>;
1960
1968
 
1961
1969
  emitPairingCallback(opts: {
@@ -1963,7 +1971,7 @@ export namespace HomeyAPIV3Cloud {
1963
1971
 
1964
1972
  callbackId: string;
1965
1973
 
1966
- data?: object;
1974
+ data?: any;
1967
1975
  }): Promise<any>;
1968
1976
 
1969
1977
  createPairSessionDevice(opts: {
@@ -2138,10 +2146,22 @@ export namespace HomeyAPIV3Cloud {
2138
2146
 
2139
2147
  deleteFlowFolder(opts: { id: string }): Promise<any>;
2140
2148
 
2149
+ getFlowCardTrigger(opts: {
2150
+ id: string;
2151
+
2152
+ uri: string;
2153
+ }): Promise<HomeyAPIV3Cloud.ManagerFlow.FlowCardTrigger>;
2154
+
2141
2155
  getFlowCardTriggers(): Promise<{
2142
2156
  [key: string]: HomeyAPIV3Cloud.ManagerFlow.FlowCardTrigger;
2143
2157
  }>;
2144
2158
 
2159
+ getFlowCardCondition(opts: {
2160
+ id: string;
2161
+
2162
+ uri: string;
2163
+ }): Promise<HomeyAPIV3Cloud.ManagerFlow.FlowCardCondition>;
2164
+
2145
2165
  getFlowCardConditions(): Promise<{
2146
2166
  [key: string]: HomeyAPIV3Cloud.ManagerFlow.FlowCardCondition;
2147
2167
  }>;
@@ -2160,6 +2180,12 @@ export namespace HomeyAPIV3Cloud {
2160
2180
  droptoken?: string;
2161
2181
  }): Promise<any>;
2162
2182
 
2183
+ getFlowCardAction(opts: {
2184
+ id: string;
2185
+
2186
+ uri: string;
2187
+ }): Promise<HomeyAPIV3Cloud.ManagerFlow.FlowCardAction>;
2188
+
2163
2189
  getFlowCardActions(): Promise<{
2164
2190
  [key: string]: HomeyAPIV3Cloud.ManagerFlow.FlowCardAction;
2165
2191
  }>;
@@ -2223,6 +2249,12 @@ export namespace HomeyAPIV3Cloud {
2223
2249
  getFlowTokens(): Promise<{
2224
2250
  [key: string]: HomeyAPIV3Cloud.ManagerFlowToken.FlowToken;
2225
2251
  }>;
2252
+
2253
+ getFlowToken(opts: {
2254
+ id: string;
2255
+ }): Promise<HomeyAPIV3Cloud.ManagerFlowToken.FlowToken>;
2256
+
2257
+ getFlowTokenValue(opts: { id: string }): Promise<any>;
2226
2258
  }
2227
2259
 
2228
2260
  export class ManagerGeolocation extends HomeyAPIV3.ManagerGeolocation {
@@ -2238,12 +2270,6 @@ export namespace HomeyAPIV3Cloud {
2238
2270
 
2239
2271
  unsetOptionLocation(): Promise<any>;
2240
2272
 
2241
- getOptionMode(): Promise<any>;
2242
-
2243
- setOptionMode(opts: { value: any }): Promise<any>;
2244
-
2245
- unsetOptionMode(): Promise<any>;
2246
-
2247
2273
  getState(): Promise<any>;
2248
2274
  }
2249
2275
 
@@ -2306,6 +2332,10 @@ export namespace HomeyAPIV3Cloud {
2306
2332
  export class ManagerLogic extends HomeyAPIV3.ManagerLogic {
2307
2333
  getState(): Promise<any>;
2308
2334
 
2335
+ getVariable(opts: {
2336
+ id: string;
2337
+ }): Promise<HomeyAPIV3Cloud.ManagerLogic.Variable>;
2338
+
2309
2339
  getVariables(): Promise<{
2310
2340
  [key: string]: HomeyAPIV3Cloud.ManagerLogic.Variable;
2311
2341
  }>;
@@ -2396,6 +2426,8 @@ export namespace HomeyAPIV3Cloud {
2396
2426
  value?: boolean;
2397
2427
  }): Promise<any>;
2398
2428
 
2429
+ getPresent(opts: { id: string }): Promise<any>;
2430
+
2399
2431
  setAsleepMe(opts: {
2400
2432
  value?: boolean;
2401
2433
 
@@ -2409,6 +2441,8 @@ export namespace HomeyAPIV3Cloud {
2409
2441
 
2410
2442
  value?: boolean;
2411
2443
  }): Promise<any>;
2444
+
2445
+ getAsleep(opts: { id: string }): Promise<any>;
2412
2446
  }
2413
2447
 
2414
2448
  export class ManagerRF extends HomeyAPIV3.ManagerRF {
@@ -2572,6 +2606,8 @@ export namespace HomeyAPIV3Cloud {
2572
2606
 
2573
2607
  getZones(): Promise<{ [key: string]: HomeyAPIV3Cloud.ManagerZones.Zone }>;
2574
2608
 
2609
+ getZone(opts: { id: string }): Promise<HomeyAPIV3Cloud.ManagerZones.Zone>;
2610
+
2575
2611
  createZone(opts: {
2576
2612
  zone: {
2577
2613
  name: string;
@@ -3492,9 +3528,9 @@ export namespace HomeyAPIV3Local {
3492
3528
 
3493
3529
  getExperiments(): Promise<any>;
3494
3530
 
3495
- enableExperiment(opts: { experimentId: string }): Promise<any>;
3531
+ enableExperiment(opts: { id: string }): Promise<any>;
3496
3532
 
3497
- disableExperiment(opts: { experimentId: string }): Promise<any>;
3533
+ disableExperiment(opts: { id: string }): Promise<any>;
3498
3534
  }
3499
3535
 
3500
3536
  export class ManagerFlow extends HomeyAPIV3.ManagerFlow {
@@ -3828,6 +3864,12 @@ export namespace HomeyAPIV3Local {
3828
3864
  }
3829
3865
 
3830
3866
  export class ManagerMatter extends HomeyAPIV3.ManagerMatter {
3867
+ getOptionPaaSettings(): Promise<any>;
3868
+
3869
+ setOptionPaaSettings(opts: { value: any }): Promise<any>;
3870
+
3871
+ unsetOptionPaaSettings(): Promise<any>;
3872
+
3831
3873
  getState(): Promise<any>;
3832
3874
  }
3833
3875
 
@@ -3987,6 +4029,10 @@ export namespace HomeyAPIV3Local {
3987
4029
  rebootOTA(): Promise<any>;
3988
4030
 
3989
4031
  setDebug(opts: { namespace: string }): Promise<any>;
4032
+
4033
+ enableWifi(): Promise<any>;
4034
+
4035
+ disableWifi(): Promise<any>;
3990
4036
  }
3991
4037
 
3992
4038
  export class ManagerThread extends HomeyAPIV3.ManagerThread {
@@ -1409,6 +1409,10 @@ export namespace HomeyAPIV3Local.ManagerVirtualDevice {
1409
1409
  id: string;
1410
1410
  }
1411
1411
 
1412
+ export class VirtualDeviceMatter {
1413
+ id: string;
1414
+ }
1415
+
1412
1416
  export class VirtualDeviceVirtualButton {
1413
1417
  id: string;
1414
1418
  }
@@ -1441,6 +1445,10 @@ export namespace HomeyAPIV3Local.ManagerVirtualDevice {
1441
1445
  id: string;
1442
1446
  }
1443
1447
 
1448
+ export class VirtualDriverMatter {
1449
+ id: string;
1450
+ }
1451
+
1444
1452
  export class VirtualDriverVirtualButton {
1445
1453
  id: string;
1446
1454
  }
@@ -7545,7 +7553,7 @@ export namespace HomeyAPIV3Cloud {
7545
7553
 
7546
7554
  id: string;
7547
7555
 
7548
- value: object;
7556
+ value: any;
7549
7557
  }): Promise<any>;
7550
7558
 
7551
7559
  unsetAppSetting(opts: {
@@ -7753,7 +7761,7 @@ export namespace HomeyAPIV3Cloud {
7753
7761
 
7754
7762
  event: string;
7755
7763
 
7756
- data?: object;
7764
+ data?: any;
7757
7765
  }): Promise<any>;
7758
7766
 
7759
7767
  emitPairingCallback(opts: {
@@ -7761,7 +7769,7 @@ export namespace HomeyAPIV3Cloud {
7761
7769
 
7762
7770
  callbackId: string;
7763
7771
 
7764
- data?: object;
7772
+ data?: any;
7765
7773
  }): Promise<any>;
7766
7774
 
7767
7775
  createPairSessionDevice(opts: {
@@ -7936,10 +7944,22 @@ export namespace HomeyAPIV3Cloud {
7936
7944
 
7937
7945
  deleteFlowFolder(opts: { id: string }): Promise<any>;
7938
7946
 
7947
+ getFlowCardTrigger(opts: {
7948
+ id: string;
7949
+
7950
+ uri: string;
7951
+ }): Promise<HomeyAPIV3Cloud.ManagerFlow.FlowCardTrigger>;
7952
+
7939
7953
  getFlowCardTriggers(): Promise<{
7940
7954
  [key: string]: HomeyAPIV3Cloud.ManagerFlow.FlowCardTrigger;
7941
7955
  }>;
7942
7956
 
7957
+ getFlowCardCondition(opts: {
7958
+ id: string;
7959
+
7960
+ uri: string;
7961
+ }): Promise<HomeyAPIV3Cloud.ManagerFlow.FlowCardCondition>;
7962
+
7943
7963
  getFlowCardConditions(): Promise<{
7944
7964
  [key: string]: HomeyAPIV3Cloud.ManagerFlow.FlowCardCondition;
7945
7965
  }>;
@@ -7958,6 +7978,12 @@ export namespace HomeyAPIV3Cloud {
7958
7978
  droptoken?: string;
7959
7979
  }): Promise<any>;
7960
7980
 
7981
+ getFlowCardAction(opts: {
7982
+ id: string;
7983
+
7984
+ uri: string;
7985
+ }): Promise<HomeyAPIV3Cloud.ManagerFlow.FlowCardAction>;
7986
+
7961
7987
  getFlowCardActions(): Promise<{
7962
7988
  [key: string]: HomeyAPIV3Cloud.ManagerFlow.FlowCardAction;
7963
7989
  }>;
@@ -8021,6 +8047,12 @@ export namespace HomeyAPIV3Cloud {
8021
8047
  getFlowTokens(): Promise<{
8022
8048
  [key: string]: HomeyAPIV3Cloud.ManagerFlowToken.FlowToken;
8023
8049
  }>;
8050
+
8051
+ getFlowToken(opts: {
8052
+ id: string;
8053
+ }): Promise<HomeyAPIV3Cloud.ManagerFlowToken.FlowToken>;
8054
+
8055
+ getFlowTokenValue(opts: { id: string }): Promise<any>;
8024
8056
  }
8025
8057
 
8026
8058
  export class ManagerGeolocation extends HomeyAPIV3.ManagerGeolocation {
@@ -8036,12 +8068,6 @@ export namespace HomeyAPIV3Cloud {
8036
8068
 
8037
8069
  unsetOptionLocation(): Promise<any>;
8038
8070
 
8039
- getOptionMode(): Promise<any>;
8040
-
8041
- setOptionMode(opts: { value: any }): Promise<any>;
8042
-
8043
- unsetOptionMode(): Promise<any>;
8044
-
8045
8071
  getState(): Promise<any>;
8046
8072
  }
8047
8073
 
@@ -8104,6 +8130,10 @@ export namespace HomeyAPIV3Cloud {
8104
8130
  export class ManagerLogic extends HomeyAPIV3.ManagerLogic {
8105
8131
  getState(): Promise<any>;
8106
8132
 
8133
+ getVariable(opts: {
8134
+ id: string;
8135
+ }): Promise<HomeyAPIV3Cloud.ManagerLogic.Variable>;
8136
+
8107
8137
  getVariables(): Promise<{
8108
8138
  [key: string]: HomeyAPIV3Cloud.ManagerLogic.Variable;
8109
8139
  }>;
@@ -8194,6 +8224,8 @@ export namespace HomeyAPIV3Cloud {
8194
8224
  value?: boolean;
8195
8225
  }): Promise<any>;
8196
8226
 
8227
+ getPresent(opts: { id: string }): Promise<any>;
8228
+
8197
8229
  setAsleepMe(opts: {
8198
8230
  value?: boolean;
8199
8231
 
@@ -8207,6 +8239,8 @@ export namespace HomeyAPIV3Cloud {
8207
8239
 
8208
8240
  value?: boolean;
8209
8241
  }): Promise<any>;
8242
+
8243
+ getAsleep(opts: { id: string }): Promise<any>;
8210
8244
  }
8211
8245
 
8212
8246
  export class ManagerRF extends HomeyAPIV3.ManagerRF {
@@ -8363,6 +8397,14 @@ export namespace HomeyAPIV3Cloud {
8363
8397
 
8364
8398
  opts?: object;
8365
8399
  }): Promise<any>;
8400
+
8401
+ verifyFirmware(): Promise<any>;
8402
+
8403
+ flashFirmware(opts: { keepNV: boolean }): Promise<any>;
8404
+
8405
+ getLastFlashResult(): Promise<any>;
8406
+
8407
+ eraseNV(): Promise<any>;
8366
8408
  }
8367
8409
 
8368
8410
  export class ManagerZones extends HomeyAPIV3.ManagerZones {
@@ -8370,6 +8412,8 @@ export namespace HomeyAPIV3Cloud {
8370
8412
 
8371
8413
  getZones(): Promise<{ [key: string]: HomeyAPIV3Cloud.ManagerZones.Zone }>;
8372
8414
 
8415
+ getZone(opts: { id: string }): Promise<HomeyAPIV3Cloud.ManagerZones.Zone>;
8416
+
8373
8417
  createZone(opts: {
8374
8418
  zone: {
8375
8419
  name: string;
@@ -9356,9 +9400,9 @@ export namespace HomeyAPIV3Local {
9356
9400
 
9357
9401
  getExperiments(): Promise<any>;
9358
9402
 
9359
- enableExperiment(opts: { experimentId: string }): Promise<any>;
9403
+ enableExperiment(opts: { id: string }): Promise<any>;
9360
9404
 
9361
- disableExperiment(opts: { experimentId: string }): Promise<any>;
9405
+ disableExperiment(opts: { id: string }): Promise<any>;
9362
9406
  }
9363
9407
 
9364
9408
  export class ManagerFlow extends HomeyAPIV3.ManagerFlow {
@@ -9692,7 +9736,27 @@ export namespace HomeyAPIV3Local {
9692
9736
  }
9693
9737
 
9694
9738
  export class ManagerMatter extends HomeyAPIV3.ManagerMatter {
9739
+ getOptionPaaSettings(): Promise<any>;
9740
+
9741
+ setOptionPaaSettings(opts: { value: any }): Promise<any>;
9742
+
9743
+ unsetOptionPaaSettings(): Promise<any>;
9744
+
9695
9745
  getState(): Promise<any>;
9746
+
9747
+ pairApi(opts: {
9748
+ code: string;
9749
+
9750
+ zone?: string;
9751
+ }): Promise<any>;
9752
+
9753
+ updateDCLPaaCerts(): Promise<any>;
9754
+
9755
+ interview(opts: { nodeId: string }): Promise<any>;
9756
+
9757
+ makeDeviceApi(opts: { nodeId: string }): Promise<any>;
9758
+
9759
+ readBasicInformation(opts: { nodeId: string }): Promise<any>;
9696
9760
  }
9697
9761
 
9698
9762
  export class ManagerMobile extends HomeyAPIV3.ManagerMobile {
@@ -9851,6 +9915,10 @@ export namespace HomeyAPIV3Local {
9851
9915
  rebootOTA(): Promise<any>;
9852
9916
 
9853
9917
  setDebug(opts: { namespace: string }): Promise<any>;
9918
+
9919
+ enableWifi(): Promise<any>;
9920
+
9921
+ disableWifi(): Promise<any>;
9854
9922
  }
9855
9923
 
9856
9924
  export class ManagerThread extends HomeyAPIV3.ManagerThread {
@@ -10009,6 +10077,8 @@ export namespace HomeyAPIV3Local {
10009
10077
  getLog(): Promise<any>;
10010
10078
 
10011
10079
  setLogEnabled(opts: { enabled: boolean }): Promise<any>;
10080
+
10081
+ setLBTThreshold(opts: { threshold: number }): Promise<any>;
10012
10082
  }
10013
10083
  }
10014
10084
 
@@ -22,7 +22,7 @@ class ManagerFlow extends ManagerFlowV3 {
22
22
  flow,
23
23
  ...props
24
24
  }) {
25
- return this.__super__.createFlow({
25
+ return this.__super__createFlow({
26
26
  flow: Flow.transformSet(flow),
27
27
  ...props,
28
28
  });
@@ -32,7 +32,7 @@ class ManagerFlow extends ManagerFlowV3 {
32
32
  flow,
33
33
  ...props
34
34
  }) {
35
- return this.__super__.updateFlow({
35
+ return this.__super__updateFlow({
36
36
  flow: Flow.transformSet(flow),
37
37
  ...props,
38
38
  });
@@ -42,7 +42,7 @@ class ManagerFlow extends ManagerFlowV3 {
42
42
  advancedflow,
43
43
  ...props
44
44
  }) {
45
- return this.__super__.createAdvancedFlow({
45
+ return this.__super__createAdvancedFlow({
46
46
  advancedflow: AdvancedFlow.transformSet(advancedflow),
47
47
  ...props,
48
48
  });
@@ -52,7 +52,7 @@ class ManagerFlow extends ManagerFlowV3 {
52
52
  advancedflow,
53
53
  ...props
54
54
  }) {
55
- return this.__super__.updateAdvancedFlow({
55
+ return this.__super__updateAdvancedFlow({
56
56
  advancedflow: AdvancedFlow.transformSet(advancedflow),
57
57
  ...props,
58
58
  });
@@ -122,6 +122,17 @@ class ManagerFlow extends ManagerFlowV3 {
122
122
  });
123
123
  }
124
124
 
125
+ async getFlowCardAutocomplete({
126
+ id,
127
+ ...props
128
+ }) {
129
+ return this.__super__getFlowCardAutocomplete({
130
+ id: id.split(':').reverse()[0],
131
+ uri: id.split(':', 3).join(':'),
132
+ ...props,
133
+ });
134
+ }
135
+
125
136
  }
126
137
 
127
138
  module.exports = ManagerFlow;
@@ -130,7 +130,7 @@ class Manager extends EventEmitter {
130
130
  }
131
131
 
132
132
  if (typeof value !== 'undefined') {
133
- if (parameter.type === 'string' && typeof value !== 'string') {
133
+ if (parameter.in !== 'query' && parameter.type === 'string' && typeof value !== 'string') {
134
134
  throw new Error(`Invalid Parameter Type: ${parameterId}. Got: ${typeof value}. Expected: string`);
135
135
  }
136
136
 
@@ -160,10 +160,6 @@ class Manager extends EventEmitter {
160
160
  if (typeof value !== 'undefined') {
161
161
  switch (parameter.in) {
162
162
  case 'path': {
163
- if (typeof value !== 'string') {
164
- throw new Error(`Invalid Parameter Type: ${parameterId}. Got: ${typeof value}. Expected: string`);
165
- }
166
-
167
163
  path = path.replace(`:${parameterId}`, value);
168
164
  break;
169
165
  }
@@ -176,10 +172,6 @@ class Manager extends EventEmitter {
176
172
  break;
177
173
  }
178
174
  case 'query': {
179
- if (typeof value !== 'string') {
180
- throw new Error(`Invalid Parameter Type: ${parameterId}. Got: ${typeof value}. Expected: string`);
181
- }
182
-
183
175
  query[parameterId] = value;
184
176
  break;
185
177
  }
@@ -193,9 +185,7 @@ class Manager extends EventEmitter {
193
185
 
194
186
  // Append query to path
195
187
  if (Object.keys(query).length > 0) {
196
- const queryString = Object.entries(query).map(([key, value]) => {
197
- return `${key}=${encodeURIComponent(value)}`;
198
- }).join('&');
188
+ const queryString = Util.serializeQueryObject(query);
199
189
  path = `${path}?${queryString}`;
200
190
  }
201
191
 
@@ -7,21 +7,47 @@ class ManagerUsers extends Manager {
7
7
  __userMe = null;
8
8
 
9
9
  async getUserMe(...args) {
10
- if (this.__userMe != null) {
10
+ const options = args[0] ?? {};
11
+
12
+ if (this.__userMe != null && options.$cache !== false) {
11
13
  return await this.__userMe;
12
14
  }
13
15
 
14
16
  // TODO
15
17
  //
16
- // - dont cache if args contains cache false
17
- // - dont cache if not connected to manager users
18
- // - remove on disonnect manager users
19
- // - set the user in the users cache
20
-
21
- this.__userMe = this.__super__getUserMe(...args).catch(err => {
22
- this.__userMe = null;
23
- throw err;
24
- });
18
+ // - remove on disconnect manager users
19
+
20
+ this.__userMe = this.__super__getUserMe(...args)
21
+ .then((result) => {
22
+ const ItemClass = this.itemClasses.User;
23
+ const props = ItemClass.transformGet(result);
24
+
25
+ if (this.isConnected()) {
26
+ if (this.__cache[ItemClass.ID][props.id] != null) {
27
+ this.__cache[ItemClass.ID][props.id].__update(props);
28
+ } else {
29
+ this.__cache[ItemClass.ID][props.id] = new ItemClass({
30
+ id: props.id,
31
+ homey: this.homey,
32
+ manager: this,
33
+ properties: props,
34
+ });
35
+ }
36
+
37
+ return this.__cache[ItemClass.ID][props.id];
38
+ }
39
+
40
+ return new ItemClass({
41
+ id: props.id,
42
+ homey: this.homey,
43
+ manager: this,
44
+ properties: props,
45
+ });
46
+ })
47
+ .catch(err => {
48
+ this.__userMe = null;
49
+ throw err;
50
+ });
25
51
 
26
52
  return await this.__userMe;
27
53
  }
package/lib/Util.js CHANGED
@@ -256,6 +256,59 @@ class Util {
256
256
  });
257
257
  }
258
258
 
259
+ static serializeQueryObject(queryObject) {
260
+ let prefix;
261
+ let querystring = [];
262
+ let rbracket = /\[\]$/;
263
+
264
+ function add(key, value) {
265
+ // If value is a function, invoke it and return its value.
266
+ value = (typeof value === 'function') ?
267
+ value() :
268
+ value === null ?
269
+ '' :
270
+ value;
271
+ querystring[querystring.length] = encodeURIComponent(key) +
272
+ '=' + encodeURIComponent(value);
273
+ }
274
+
275
+ function buildParams(prefix, obj, add) {
276
+ let name;
277
+ if (Array.isArray(obj)) {
278
+ // Serialize array item.
279
+ for (let index = 0; index < obj.length; index++) {
280
+ if (rbracket.test(prefix)) {
281
+ // Treat each array item as a scalar.
282
+ add(prefix, obj[index]);
283
+ } else {
284
+ // Item is non-scalar (array or object), encode its numeric index.
285
+ buildParams(prefix + '[' + (typeof (obj[index]) === 'object' ?
286
+ index :
287
+ ''
288
+ ) + ']', obj[index], add);
289
+ }
290
+ }
291
+ } else if (typeof obj === 'object') {
292
+ // Serialize object item.
293
+ for (name in obj) {
294
+ buildParams(prefix + '[' + name + ']', obj[name], add);
295
+ }
296
+ } else {
297
+ // Serialize scalar item.
298
+ add(prefix, obj);
299
+ }
300
+ }
301
+
302
+ // Encode params recursively.
303
+ for (prefix in queryObject) {
304
+ if (typeof queryObject[prefix] === 'undefined') continue;
305
+ buildParams(prefix, queryObject[prefix], add);
306
+ }
307
+
308
+ // Return the resulting serialization.
309
+ return querystring.join('&');
310
+ }
311
+
259
312
  }
260
313
 
261
314
  module.exports = Util;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homey-api",
3
- "version": "3.0.11",
3
+ "version": "3.0.13",
4
4
  "description": "Homey API",
5
5
  "main": "index.js",
6
6
  "files": [