homey-api 1.5.21 → 1.5.22
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/types/homey-api.d.ts +87 -85
- package/assets/types/homey-api.private.d.ts +94 -92
- package/lib/{HomeyAPI/HomeyOfflineError.js → APIErrorHomeyOffline.js} +3 -4
- package/lib/APIErrorTimeout.js +0 -1
- package/lib/HomeyAPI/HomeyAPIV2.js +8 -8
- package/lib/Util.js +23 -0
- package/package.json +1 -1
|
@@ -31,6 +31,30 @@
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class APIErrorHomeyOffline extends APIError {
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
message: string;
|
|
41
|
+
|
|
42
|
+
statusCode: number;
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export class APIErrorTimeout extends APIError {
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
message: string;
|
|
53
|
+
|
|
54
|
+
statusCode: number;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
34
58
|
}
|
|
35
59
|
|
|
36
60
|
export class AthomCloudAPI {
|
|
@@ -694,6 +718,8 @@
|
|
|
694
718
|
|
|
695
719
|
value: boolean | number | string | null;
|
|
696
720
|
|
|
721
|
+
lastChanged: Date | null;
|
|
722
|
+
|
|
697
723
|
|
|
698
724
|
|
|
699
725
|
destroy(
|
|
@@ -2186,18 +2212,6 @@
|
|
|
2186
2212
|
|
|
2187
2213
|
export namespace HomeyAPI {
|
|
2188
2214
|
|
|
2189
|
-
export class APIErrorTimeout extends APIError {
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
message: string;
|
|
2194
|
-
|
|
2195
|
-
statusCode: number;
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
}
|
|
2200
|
-
|
|
2201
2215
|
export class HomeyAPIError extends APIError {
|
|
2202
2216
|
|
|
2203
2217
|
|
|
@@ -2212,18 +2226,6 @@
|
|
|
2212
2226
|
|
|
2213
2227
|
|
|
2214
2228
|
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
export class HomeyOfflineError extends APIError {
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
message: string;
|
|
2222
|
-
|
|
2223
|
-
statusCode: number;
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
2229
|
}
|
|
2228
2230
|
|
|
2229
2231
|
}
|
|
@@ -2757,7 +2759,7 @@
|
|
|
2757
2759
|
|
|
2758
2760
|
|
|
2759
2761
|
|
|
2760
|
-
settings:
|
|
2762
|
+
settings: *,
|
|
2761
2763
|
|
|
2762
2764
|
|
|
2763
2765
|
},
|
|
@@ -2785,7 +2787,7 @@
|
|
|
2785
2787
|
|
|
2786
2788
|
|
|
2787
2789
|
|
|
2788
|
-
device:
|
|
2790
|
+
device: *,
|
|
2789
2791
|
|
|
2790
2792
|
|
|
2791
2793
|
},
|
|
@@ -2854,7 +2856,7 @@
|
|
|
2854
2856
|
|
|
2855
2857
|
|
|
2856
2858
|
|
|
2857
|
-
value:
|
|
2859
|
+
value: *,
|
|
2858
2860
|
|
|
2859
2861
|
|
|
2860
2862
|
|
|
@@ -3003,7 +3005,7 @@
|
|
|
3003
3005
|
opts: {
|
|
3004
3006
|
|
|
3005
3007
|
|
|
3006
|
-
pairsession:
|
|
3008
|
+
pairsession: *,
|
|
3007
3009
|
|
|
3008
3010
|
|
|
3009
3011
|
},
|
|
@@ -3118,7 +3120,7 @@
|
|
|
3118
3120
|
|
|
3119
3121
|
|
|
3120
3122
|
|
|
3121
|
-
device:
|
|
3123
|
+
device: *,
|
|
3122
3124
|
|
|
3123
3125
|
|
|
3124
3126
|
},
|
|
@@ -3141,7 +3143,7 @@
|
|
|
3141
3143
|
|
|
3142
3144
|
|
|
3143
3145
|
|
|
3144
|
-
device:
|
|
3146
|
+
device: *,
|
|
3145
3147
|
|
|
3146
3148
|
|
|
3147
3149
|
},
|
|
@@ -3278,7 +3280,7 @@
|
|
|
3278
3280
|
opts: {
|
|
3279
3281
|
|
|
3280
3282
|
|
|
3281
|
-
flow:
|
|
3283
|
+
flow: *,
|
|
3282
3284
|
|
|
3283
3285
|
|
|
3284
3286
|
},
|
|
@@ -3301,7 +3303,7 @@
|
|
|
3301
3303
|
|
|
3302
3304
|
|
|
3303
3305
|
|
|
3304
|
-
flow:
|
|
3306
|
+
flow: *,
|
|
3305
3307
|
|
|
3306
3308
|
|
|
3307
3309
|
},
|
|
@@ -3339,7 +3341,7 @@
|
|
|
3339
3341
|
opts: {
|
|
3340
3342
|
|
|
3341
3343
|
|
|
3342
|
-
flow:
|
|
3344
|
+
flow: *,
|
|
3343
3345
|
|
|
3344
3346
|
|
|
3345
3347
|
|
|
@@ -3428,7 +3430,7 @@
|
|
|
3428
3430
|
opts: {
|
|
3429
3431
|
|
|
3430
3432
|
|
|
3431
|
-
flowfolder:
|
|
3433
|
+
flowfolder: *,
|
|
3432
3434
|
|
|
3433
3435
|
|
|
3434
3436
|
},
|
|
@@ -3451,7 +3453,7 @@
|
|
|
3451
3453
|
|
|
3452
3454
|
|
|
3453
3455
|
|
|
3454
|
-
flowfolder:
|
|
3456
|
+
flowfolder: *,
|
|
3455
3457
|
|
|
3456
3458
|
|
|
3457
3459
|
},
|
|
@@ -3661,7 +3663,7 @@
|
|
|
3661
3663
|
opts: {
|
|
3662
3664
|
|
|
3663
3665
|
|
|
3664
|
-
value:
|
|
3666
|
+
value: *,
|
|
3665
3667
|
|
|
3666
3668
|
|
|
3667
3669
|
},
|
|
@@ -3690,7 +3692,7 @@
|
|
|
3690
3692
|
opts: {
|
|
3691
3693
|
|
|
3692
3694
|
|
|
3693
|
-
value:
|
|
3695
|
+
value: *,
|
|
3694
3696
|
|
|
3695
3697
|
|
|
3696
3698
|
},
|
|
@@ -3747,7 +3749,7 @@
|
|
|
3747
3749
|
opts: {
|
|
3748
3750
|
|
|
3749
3751
|
|
|
3750
|
-
value:
|
|
3752
|
+
value: *,
|
|
3751
3753
|
|
|
3752
3754
|
|
|
3753
3755
|
},
|
|
@@ -3776,7 +3778,7 @@
|
|
|
3776
3778
|
opts: {
|
|
3777
3779
|
|
|
3778
3780
|
|
|
3779
|
-
value:
|
|
3781
|
+
value: *,
|
|
3780
3782
|
|
|
3781
3783
|
|
|
3782
3784
|
},
|
|
@@ -4001,7 +4003,7 @@
|
|
|
4001
4003
|
opts: {
|
|
4002
4004
|
|
|
4003
4005
|
|
|
4004
|
-
variable:
|
|
4006
|
+
variable: *,
|
|
4005
4007
|
|
|
4006
4008
|
|
|
4007
4009
|
},
|
|
@@ -4024,7 +4026,7 @@
|
|
|
4024
4026
|
|
|
4025
4027
|
|
|
4026
4028
|
|
|
4027
|
-
variable:
|
|
4029
|
+
variable: *,
|
|
4028
4030
|
|
|
4029
4031
|
|
|
4030
4032
|
},
|
|
@@ -4106,7 +4108,7 @@
|
|
|
4106
4108
|
|
|
4107
4109
|
|
|
4108
4110
|
|
|
4109
|
-
data:
|
|
4111
|
+
data: *,
|
|
4110
4112
|
|
|
4111
4113
|
|
|
4112
4114
|
|
|
@@ -4703,7 +4705,7 @@
|
|
|
4703
4705
|
opts: {
|
|
4704
4706
|
|
|
4705
4707
|
|
|
4706
|
-
user:
|
|
4708
|
+
user: *,
|
|
4707
4709
|
|
|
4708
4710
|
|
|
4709
4711
|
},
|
|
@@ -4726,7 +4728,7 @@
|
|
|
4726
4728
|
|
|
4727
4729
|
|
|
4728
4730
|
|
|
4729
|
-
user:
|
|
4731
|
+
user: *,
|
|
4730
4732
|
|
|
4731
4733
|
|
|
4732
4734
|
},
|
|
@@ -5029,7 +5031,7 @@
|
|
|
5029
5031
|
opts: {
|
|
5030
5032
|
|
|
5031
5033
|
|
|
5032
|
-
zone:
|
|
5034
|
+
zone: *,
|
|
5033
5035
|
|
|
5034
5036
|
|
|
5035
5037
|
},
|
|
@@ -5052,7 +5054,7 @@
|
|
|
5052
5054
|
|
|
5053
5055
|
|
|
5054
5056
|
|
|
5055
|
-
zone:
|
|
5057
|
+
zone: *,
|
|
5056
5058
|
|
|
5057
5059
|
|
|
5058
5060
|
},
|
|
@@ -5158,6 +5160,8 @@
|
|
|
5158
5160
|
|
|
5159
5161
|
|
|
5160
5162
|
|
|
5163
|
+
|
|
5164
|
+
|
|
5161
5165
|
export namespace HomeyAPIV2 {
|
|
5162
5166
|
|
|
5163
5167
|
export class Manager {
|
|
@@ -5232,7 +5236,7 @@
|
|
|
5232
5236
|
|
|
5233
5237
|
|
|
5234
5238
|
|
|
5235
|
-
alarm:
|
|
5239
|
+
alarm: *,
|
|
5236
5240
|
|
|
5237
5241
|
|
|
5238
5242
|
},
|
|
@@ -5251,7 +5255,7 @@
|
|
|
5251
5255
|
opts: {
|
|
5252
5256
|
|
|
5253
5257
|
|
|
5254
|
-
alarm:
|
|
5258
|
+
alarm: *,
|
|
5255
5259
|
|
|
5256
5260
|
|
|
5257
5261
|
},
|
|
@@ -5489,7 +5493,7 @@
|
|
|
5489
5493
|
|
|
5490
5494
|
|
|
5491
5495
|
|
|
5492
|
-
value:
|
|
5496
|
+
value: *,
|
|
5493
5497
|
|
|
5494
5498
|
|
|
5495
5499
|
},
|
|
@@ -5577,7 +5581,7 @@
|
|
|
5577
5581
|
|
|
5578
5582
|
|
|
5579
5583
|
|
|
5580
|
-
app:
|
|
5584
|
+
app: *,
|
|
5581
5585
|
|
|
5582
5586
|
|
|
5583
5587
|
},
|
|
@@ -5930,7 +5934,7 @@
|
|
|
5930
5934
|
|
|
5931
5935
|
|
|
5932
5936
|
|
|
5933
|
-
settings:
|
|
5937
|
+
settings: *,
|
|
5934
5938
|
|
|
5935
5939
|
|
|
5936
5940
|
},
|
|
@@ -5976,15 +5980,15 @@
|
|
|
5976
5980
|
|
|
5977
5981
|
|
|
5978
5982
|
|
|
5979
|
-
transactionId:
|
|
5983
|
+
transactionId: *,
|
|
5980
5984
|
|
|
5981
5985
|
|
|
5982
5986
|
|
|
5983
|
-
opts:
|
|
5987
|
+
opts: *,
|
|
5984
5988
|
|
|
5985
5989
|
|
|
5986
5990
|
|
|
5987
|
-
value:
|
|
5991
|
+
value: *,
|
|
5988
5992
|
|
|
5989
5993
|
|
|
5990
5994
|
},
|
|
@@ -6026,7 +6030,7 @@
|
|
|
6026
6030
|
|
|
6027
6031
|
|
|
6028
6032
|
|
|
6029
|
-
device:
|
|
6033
|
+
device: *,
|
|
6030
6034
|
|
|
6031
6035
|
|
|
6032
6036
|
},
|
|
@@ -6209,7 +6213,7 @@
|
|
|
6209
6213
|
opts: {
|
|
6210
6214
|
|
|
6211
6215
|
|
|
6212
|
-
animation:
|
|
6216
|
+
animation: *,
|
|
6213
6217
|
|
|
6214
6218
|
|
|
6215
6219
|
},
|
|
@@ -6274,7 +6278,7 @@
|
|
|
6274
6278
|
|
|
6275
6279
|
|
|
6276
6280
|
|
|
6277
|
-
device:
|
|
6281
|
+
device: *,
|
|
6278
6282
|
|
|
6279
6283
|
|
|
6280
6284
|
},
|
|
@@ -6362,7 +6366,7 @@
|
|
|
6362
6366
|
|
|
6363
6367
|
|
|
6364
6368
|
|
|
6365
|
-
data:
|
|
6369
|
+
data: *,
|
|
6366
6370
|
|
|
6367
6371
|
|
|
6368
6372
|
|
|
@@ -6385,7 +6389,7 @@
|
|
|
6385
6389
|
opts: {
|
|
6386
6390
|
|
|
6387
6391
|
|
|
6388
|
-
pairsession:
|
|
6392
|
+
pairsession: *,
|
|
6389
6393
|
|
|
6390
6394
|
|
|
6391
6395
|
},
|
|
@@ -6668,7 +6672,7 @@
|
|
|
6668
6672
|
|
|
6669
6673
|
|
|
6670
6674
|
|
|
6671
|
-
advancedflow:
|
|
6675
|
+
advancedflow: *,
|
|
6672
6676
|
|
|
6673
6677
|
|
|
6674
6678
|
},
|
|
@@ -6687,7 +6691,7 @@
|
|
|
6687
6691
|
opts: {
|
|
6688
6692
|
|
|
6689
6693
|
|
|
6690
|
-
advancedflow:
|
|
6694
|
+
advancedflow: *,
|
|
6691
6695
|
|
|
6692
6696
|
|
|
6693
6697
|
},
|
|
@@ -6753,7 +6757,7 @@
|
|
|
6753
6757
|
|
|
6754
6758
|
|
|
6755
6759
|
|
|
6756
|
-
flowfolder:
|
|
6760
|
+
flowfolder: *,
|
|
6757
6761
|
|
|
6758
6762
|
|
|
6759
6763
|
},
|
|
@@ -6772,7 +6776,7 @@
|
|
|
6772
6776
|
opts: {
|
|
6773
6777
|
|
|
6774
6778
|
|
|
6775
|
-
flowfolder:
|
|
6779
|
+
flowfolder: *,
|
|
6776
6780
|
|
|
6777
6781
|
|
|
6778
6782
|
},
|
|
@@ -6819,7 +6823,7 @@
|
|
|
6819
6823
|
|
|
6820
6824
|
|
|
6821
6825
|
|
|
6822
|
-
state:
|
|
6826
|
+
state: *,
|
|
6823
6827
|
|
|
6824
6828
|
|
|
6825
6829
|
},
|
|
@@ -6846,7 +6850,7 @@
|
|
|
6846
6850
|
|
|
6847
6851
|
|
|
6848
6852
|
|
|
6849
|
-
flow:
|
|
6853
|
+
flow: *,
|
|
6850
6854
|
|
|
6851
6855
|
|
|
6852
6856
|
},
|
|
@@ -6888,7 +6892,7 @@
|
|
|
6888
6892
|
|
|
6889
6893
|
|
|
6890
6894
|
|
|
6891
|
-
flow:
|
|
6895
|
+
flow: *,
|
|
6892
6896
|
|
|
6893
6897
|
|
|
6894
6898
|
},
|
|
@@ -6907,7 +6911,7 @@
|
|
|
6907
6911
|
opts: {
|
|
6908
6912
|
|
|
6909
6913
|
|
|
6910
|
-
flow:
|
|
6914
|
+
flow: *,
|
|
6911
6915
|
|
|
6912
6916
|
|
|
6913
6917
|
},
|
|
@@ -7597,7 +7601,7 @@
|
|
|
7597
7601
|
|
|
7598
7602
|
|
|
7599
7603
|
|
|
7600
|
-
log:
|
|
7604
|
+
log: *,
|
|
7601
7605
|
|
|
7602
7606
|
|
|
7603
7607
|
},
|
|
@@ -7804,7 +7808,7 @@
|
|
|
7804
7808
|
|
|
7805
7809
|
|
|
7806
7810
|
|
|
7807
|
-
variable:
|
|
7811
|
+
variable: *,
|
|
7808
7812
|
|
|
7809
7813
|
|
|
7810
7814
|
},
|
|
@@ -7823,7 +7827,7 @@
|
|
|
7823
7827
|
opts: {
|
|
7824
7828
|
|
|
7825
7829
|
|
|
7826
|
-
variable:
|
|
7830
|
+
variable: *,
|
|
7827
7831
|
|
|
7828
7832
|
|
|
7829
7833
|
},
|
|
@@ -8076,7 +8080,7 @@
|
|
|
8076
8080
|
|
|
8077
8081
|
|
|
8078
8082
|
|
|
8079
|
-
value:
|
|
8083
|
+
value: *,
|
|
8080
8084
|
|
|
8081
8085
|
|
|
8082
8086
|
},
|
|
@@ -8095,11 +8099,11 @@
|
|
|
8095
8099
|
opts: {
|
|
8096
8100
|
|
|
8097
8101
|
|
|
8098
|
-
opts:
|
|
8102
|
+
opts: *,
|
|
8099
8103
|
|
|
8100
8104
|
|
|
8101
8105
|
|
|
8102
|
-
value:
|
|
8106
|
+
value: *,
|
|
8103
8107
|
|
|
8104
8108
|
|
|
8105
8109
|
},
|
|
@@ -8141,7 +8145,7 @@
|
|
|
8141
8145
|
|
|
8142
8146
|
|
|
8143
8147
|
|
|
8144
|
-
value:
|
|
8148
|
+
value: *,
|
|
8145
8149
|
|
|
8146
8150
|
|
|
8147
8151
|
},
|
|
@@ -8160,11 +8164,11 @@
|
|
|
8160
8164
|
opts: {
|
|
8161
8165
|
|
|
8162
8166
|
|
|
8163
|
-
opts:
|
|
8167
|
+
opts: *,
|
|
8164
8168
|
|
|
8165
8169
|
|
|
8166
8170
|
|
|
8167
|
-
value:
|
|
8171
|
+
value: *,
|
|
8168
8172
|
|
|
8169
8173
|
|
|
8170
8174
|
},
|
|
@@ -8252,7 +8256,7 @@
|
|
|
8252
8256
|
|
|
8253
8257
|
|
|
8254
8258
|
|
|
8255
|
-
data:
|
|
8259
|
+
data: *,
|
|
8256
8260
|
|
|
8257
8261
|
|
|
8258
8262
|
},
|
|
@@ -8981,7 +8985,7 @@
|
|
|
8981
8985
|
|
|
8982
8986
|
|
|
8983
8987
|
|
|
8984
|
-
user:
|
|
8988
|
+
user: *,
|
|
8985
8989
|
|
|
8986
8990
|
|
|
8987
8991
|
},
|
|
@@ -9000,11 +9004,11 @@
|
|
|
9000
9004
|
opts: {
|
|
9001
9005
|
|
|
9002
9006
|
|
|
9003
|
-
email:
|
|
9007
|
+
email: *,
|
|
9004
9008
|
|
|
9005
9009
|
|
|
9006
9010
|
|
|
9007
|
-
name:
|
|
9011
|
+
name: *,
|
|
9008
9012
|
|
|
9009
9013
|
|
|
9010
9014
|
},
|
|
@@ -9023,7 +9027,7 @@
|
|
|
9023
9027
|
opts: {
|
|
9024
9028
|
|
|
9025
9029
|
|
|
9026
|
-
user:
|
|
9030
|
+
user: *,
|
|
9027
9031
|
|
|
9028
9032
|
|
|
9029
9033
|
},
|
|
@@ -9215,7 +9219,7 @@
|
|
|
9215
9219
|
|
|
9216
9220
|
|
|
9217
9221
|
|
|
9218
|
-
zone:
|
|
9222
|
+
zone: *,
|
|
9219
9223
|
|
|
9220
9224
|
|
|
9221
9225
|
},
|
|
@@ -9234,7 +9238,7 @@
|
|
|
9234
9238
|
opts: {
|
|
9235
9239
|
|
|
9236
9240
|
|
|
9237
|
-
zone:
|
|
9241
|
+
zone: *,
|
|
9238
9242
|
|
|
9239
9243
|
|
|
9240
9244
|
},
|
|
@@ -9457,7 +9461,5 @@
|
|
|
9457
9461
|
|
|
9458
9462
|
|
|
9459
9463
|
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
9464
|
|
|
9463
9465
|
|
|
@@ -61,6 +61,30 @@
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export class APIErrorHomeyOffline extends APIError {
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
message: string;
|
|
71
|
+
|
|
72
|
+
statusCode: number;
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export class APIErrorTimeout extends APIError {
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
message: string;
|
|
83
|
+
|
|
84
|
+
statusCode: number;
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
64
88
|
}
|
|
65
89
|
|
|
66
90
|
export class AthomAppsAPI {
|
|
@@ -5763,6 +5787,8 @@
|
|
|
5763
5787
|
|
|
5764
5788
|
value: boolean | number | string | null;
|
|
5765
5789
|
|
|
5790
|
+
lastChanged: Date | null;
|
|
5791
|
+
|
|
5766
5792
|
|
|
5767
5793
|
|
|
5768
5794
|
destroy(
|
|
@@ -7317,18 +7343,6 @@
|
|
|
7317
7343
|
|
|
7318
7344
|
export namespace HomeyAPI {
|
|
7319
7345
|
|
|
7320
|
-
export class APIErrorTimeout extends APIError {
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
message: string;
|
|
7325
|
-
|
|
7326
|
-
statusCode: number;
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
}
|
|
7331
|
-
|
|
7332
7346
|
export class HomeyAPIError extends APIError {
|
|
7333
7347
|
|
|
7334
7348
|
|
|
@@ -7343,18 +7357,6 @@
|
|
|
7343
7357
|
|
|
7344
7358
|
|
|
7345
7359
|
|
|
7346
|
-
}
|
|
7347
|
-
|
|
7348
|
-
export class HomeyOfflineError extends APIError {
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
message: string;
|
|
7353
|
-
|
|
7354
|
-
statusCode: number;
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
7360
|
}
|
|
7359
7361
|
|
|
7360
7362
|
}
|
|
@@ -7842,7 +7844,7 @@
|
|
|
7842
7844
|
opts: {
|
|
7843
7845
|
|
|
7844
7846
|
|
|
7845
|
-
dashboard:
|
|
7847
|
+
dashboard: *,
|
|
7846
7848
|
|
|
7847
7849
|
|
|
7848
7850
|
},
|
|
@@ -7865,7 +7867,7 @@
|
|
|
7865
7867
|
|
|
7866
7868
|
|
|
7867
7869
|
|
|
7868
|
-
dashboard:
|
|
7870
|
+
dashboard: *,
|
|
7869
7871
|
|
|
7870
7872
|
|
|
7871
7873
|
},
|
|
@@ -8001,7 +8003,7 @@
|
|
|
8001
8003
|
|
|
8002
8004
|
|
|
8003
8005
|
|
|
8004
|
-
settings:
|
|
8006
|
+
settings: *,
|
|
8005
8007
|
|
|
8006
8008
|
|
|
8007
8009
|
},
|
|
@@ -8029,7 +8031,7 @@
|
|
|
8029
8031
|
|
|
8030
8032
|
|
|
8031
8033
|
|
|
8032
|
-
device:
|
|
8034
|
+
device: *,
|
|
8033
8035
|
|
|
8034
8036
|
|
|
8035
8037
|
},
|
|
@@ -8098,7 +8100,7 @@
|
|
|
8098
8100
|
|
|
8099
8101
|
|
|
8100
8102
|
|
|
8101
|
-
value:
|
|
8103
|
+
value: *,
|
|
8102
8104
|
|
|
8103
8105
|
|
|
8104
8106
|
|
|
@@ -8247,7 +8249,7 @@
|
|
|
8247
8249
|
opts: {
|
|
8248
8250
|
|
|
8249
8251
|
|
|
8250
|
-
pairsession:
|
|
8252
|
+
pairsession: *,
|
|
8251
8253
|
|
|
8252
8254
|
|
|
8253
8255
|
},
|
|
@@ -8362,7 +8364,7 @@
|
|
|
8362
8364
|
|
|
8363
8365
|
|
|
8364
8366
|
|
|
8365
|
-
device:
|
|
8367
|
+
device: *,
|
|
8366
8368
|
|
|
8367
8369
|
|
|
8368
8370
|
},
|
|
@@ -8385,7 +8387,7 @@
|
|
|
8385
8387
|
|
|
8386
8388
|
|
|
8387
8389
|
|
|
8388
|
-
device:
|
|
8390
|
+
device: *,
|
|
8389
8391
|
|
|
8390
8392
|
|
|
8391
8393
|
},
|
|
@@ -8522,7 +8524,7 @@
|
|
|
8522
8524
|
opts: {
|
|
8523
8525
|
|
|
8524
8526
|
|
|
8525
|
-
flow:
|
|
8527
|
+
flow: *,
|
|
8526
8528
|
|
|
8527
8529
|
|
|
8528
8530
|
},
|
|
@@ -8545,7 +8547,7 @@
|
|
|
8545
8547
|
|
|
8546
8548
|
|
|
8547
8549
|
|
|
8548
|
-
flow:
|
|
8550
|
+
flow: *,
|
|
8549
8551
|
|
|
8550
8552
|
|
|
8551
8553
|
},
|
|
@@ -8583,7 +8585,7 @@
|
|
|
8583
8585
|
opts: {
|
|
8584
8586
|
|
|
8585
8587
|
|
|
8586
|
-
flow:
|
|
8588
|
+
flow: *,
|
|
8587
8589
|
|
|
8588
8590
|
|
|
8589
8591
|
|
|
@@ -8672,7 +8674,7 @@
|
|
|
8672
8674
|
opts: {
|
|
8673
8675
|
|
|
8674
8676
|
|
|
8675
|
-
flowfolder:
|
|
8677
|
+
flowfolder: *,
|
|
8676
8678
|
|
|
8677
8679
|
|
|
8678
8680
|
},
|
|
@@ -8695,7 +8697,7 @@
|
|
|
8695
8697
|
|
|
8696
8698
|
|
|
8697
8699
|
|
|
8698
|
-
flowfolder:
|
|
8700
|
+
flowfolder: *,
|
|
8699
8701
|
|
|
8700
8702
|
|
|
8701
8703
|
},
|
|
@@ -8905,7 +8907,7 @@
|
|
|
8905
8907
|
opts: {
|
|
8906
8908
|
|
|
8907
8909
|
|
|
8908
|
-
value:
|
|
8910
|
+
value: *,
|
|
8909
8911
|
|
|
8910
8912
|
|
|
8911
8913
|
},
|
|
@@ -8934,7 +8936,7 @@
|
|
|
8934
8936
|
opts: {
|
|
8935
8937
|
|
|
8936
8938
|
|
|
8937
|
-
value:
|
|
8939
|
+
value: *,
|
|
8938
8940
|
|
|
8939
8941
|
|
|
8940
8942
|
},
|
|
@@ -8991,7 +8993,7 @@
|
|
|
8991
8993
|
opts: {
|
|
8992
8994
|
|
|
8993
8995
|
|
|
8994
|
-
value:
|
|
8996
|
+
value: *,
|
|
8995
8997
|
|
|
8996
8998
|
|
|
8997
8999
|
},
|
|
@@ -9020,7 +9022,7 @@
|
|
|
9020
9022
|
opts: {
|
|
9021
9023
|
|
|
9022
9024
|
|
|
9023
|
-
value:
|
|
9025
|
+
value: *,
|
|
9024
9026
|
|
|
9025
9027
|
|
|
9026
9028
|
},
|
|
@@ -9245,7 +9247,7 @@
|
|
|
9245
9247
|
opts: {
|
|
9246
9248
|
|
|
9247
9249
|
|
|
9248
|
-
variable:
|
|
9250
|
+
variable: *,
|
|
9249
9251
|
|
|
9250
9252
|
|
|
9251
9253
|
},
|
|
@@ -9268,7 +9270,7 @@
|
|
|
9268
9270
|
|
|
9269
9271
|
|
|
9270
9272
|
|
|
9271
|
-
variable:
|
|
9273
|
+
variable: *,
|
|
9272
9274
|
|
|
9273
9275
|
|
|
9274
9276
|
},
|
|
@@ -9350,7 +9352,7 @@
|
|
|
9350
9352
|
|
|
9351
9353
|
|
|
9352
9354
|
|
|
9353
|
-
data:
|
|
9355
|
+
data: *,
|
|
9354
9356
|
|
|
9355
9357
|
|
|
9356
9358
|
|
|
@@ -9947,7 +9949,7 @@
|
|
|
9947
9949
|
opts: {
|
|
9948
9950
|
|
|
9949
9951
|
|
|
9950
|
-
user:
|
|
9952
|
+
user: *,
|
|
9951
9953
|
|
|
9952
9954
|
|
|
9953
9955
|
},
|
|
@@ -9970,7 +9972,7 @@
|
|
|
9970
9972
|
|
|
9971
9973
|
|
|
9972
9974
|
|
|
9973
|
-
user:
|
|
9975
|
+
user: *,
|
|
9974
9976
|
|
|
9975
9977
|
|
|
9976
9978
|
},
|
|
@@ -10273,7 +10275,7 @@
|
|
|
10273
10275
|
opts: {
|
|
10274
10276
|
|
|
10275
10277
|
|
|
10276
|
-
zone:
|
|
10278
|
+
zone: *,
|
|
10277
10279
|
|
|
10278
10280
|
|
|
10279
10281
|
},
|
|
@@ -10296,7 +10298,7 @@
|
|
|
10296
10298
|
|
|
10297
10299
|
|
|
10298
10300
|
|
|
10299
|
-
zone:
|
|
10301
|
+
zone: *,
|
|
10300
10302
|
|
|
10301
10303
|
|
|
10302
10304
|
},
|
|
@@ -10402,6 +10404,8 @@
|
|
|
10402
10404
|
|
|
10403
10405
|
|
|
10404
10406
|
|
|
10407
|
+
|
|
10408
|
+
|
|
10405
10409
|
export namespace HomeyAPIV2 {
|
|
10406
10410
|
|
|
10407
10411
|
export class Manager {
|
|
@@ -10476,7 +10480,7 @@
|
|
|
10476
10480
|
|
|
10477
10481
|
|
|
10478
10482
|
|
|
10479
|
-
alarm:
|
|
10483
|
+
alarm: *,
|
|
10480
10484
|
|
|
10481
10485
|
|
|
10482
10486
|
},
|
|
@@ -10495,7 +10499,7 @@
|
|
|
10495
10499
|
opts: {
|
|
10496
10500
|
|
|
10497
10501
|
|
|
10498
|
-
alarm:
|
|
10502
|
+
alarm: *,
|
|
10499
10503
|
|
|
10500
10504
|
|
|
10501
10505
|
},
|
|
@@ -10733,7 +10737,7 @@
|
|
|
10733
10737
|
|
|
10734
10738
|
|
|
10735
10739
|
|
|
10736
|
-
value:
|
|
10740
|
+
value: *,
|
|
10737
10741
|
|
|
10738
10742
|
|
|
10739
10743
|
},
|
|
@@ -10821,7 +10825,7 @@
|
|
|
10821
10825
|
|
|
10822
10826
|
|
|
10823
10827
|
|
|
10824
|
-
app:
|
|
10828
|
+
app: *,
|
|
10825
10829
|
|
|
10826
10830
|
|
|
10827
10831
|
},
|
|
@@ -11222,7 +11226,7 @@
|
|
|
11222
11226
|
|
|
11223
11227
|
|
|
11224
11228
|
|
|
11225
|
-
dashboard:
|
|
11229
|
+
dashboard: *,
|
|
11226
11230
|
|
|
11227
11231
|
|
|
11228
11232
|
},
|
|
@@ -11241,7 +11245,7 @@
|
|
|
11241
11245
|
opts: {
|
|
11242
11246
|
|
|
11243
11247
|
|
|
11244
|
-
dashboard:
|
|
11248
|
+
dashboard: *,
|
|
11245
11249
|
|
|
11246
11250
|
|
|
11247
11251
|
},
|
|
@@ -11367,7 +11371,7 @@
|
|
|
11367
11371
|
|
|
11368
11372
|
|
|
11369
11373
|
|
|
11370
|
-
settings:
|
|
11374
|
+
settings: *,
|
|
11371
11375
|
|
|
11372
11376
|
|
|
11373
11377
|
},
|
|
@@ -11413,15 +11417,15 @@
|
|
|
11413
11417
|
|
|
11414
11418
|
|
|
11415
11419
|
|
|
11416
|
-
transactionId:
|
|
11420
|
+
transactionId: *,
|
|
11417
11421
|
|
|
11418
11422
|
|
|
11419
11423
|
|
|
11420
|
-
opts:
|
|
11424
|
+
opts: *,
|
|
11421
11425
|
|
|
11422
11426
|
|
|
11423
11427
|
|
|
11424
|
-
value:
|
|
11428
|
+
value: *,
|
|
11425
11429
|
|
|
11426
11430
|
|
|
11427
11431
|
},
|
|
@@ -11463,7 +11467,7 @@
|
|
|
11463
11467
|
|
|
11464
11468
|
|
|
11465
11469
|
|
|
11466
|
-
device:
|
|
11470
|
+
device: *,
|
|
11467
11471
|
|
|
11468
11472
|
|
|
11469
11473
|
},
|
|
@@ -11646,7 +11650,7 @@
|
|
|
11646
11650
|
opts: {
|
|
11647
11651
|
|
|
11648
11652
|
|
|
11649
|
-
animation:
|
|
11653
|
+
animation: *,
|
|
11650
11654
|
|
|
11651
11655
|
|
|
11652
11656
|
},
|
|
@@ -11711,7 +11715,7 @@
|
|
|
11711
11715
|
|
|
11712
11716
|
|
|
11713
11717
|
|
|
11714
|
-
device:
|
|
11718
|
+
device: *,
|
|
11715
11719
|
|
|
11716
11720
|
|
|
11717
11721
|
},
|
|
@@ -11799,7 +11803,7 @@
|
|
|
11799
11803
|
|
|
11800
11804
|
|
|
11801
11805
|
|
|
11802
|
-
data:
|
|
11806
|
+
data: *,
|
|
11803
11807
|
|
|
11804
11808
|
|
|
11805
11809
|
|
|
@@ -11822,7 +11826,7 @@
|
|
|
11822
11826
|
opts: {
|
|
11823
11827
|
|
|
11824
11828
|
|
|
11825
|
-
pairsession:
|
|
11829
|
+
pairsession: *,
|
|
11826
11830
|
|
|
11827
11831
|
|
|
11828
11832
|
},
|
|
@@ -12105,7 +12109,7 @@
|
|
|
12105
12109
|
|
|
12106
12110
|
|
|
12107
12111
|
|
|
12108
|
-
advancedflow:
|
|
12112
|
+
advancedflow: *,
|
|
12109
12113
|
|
|
12110
12114
|
|
|
12111
12115
|
},
|
|
@@ -12124,7 +12128,7 @@
|
|
|
12124
12128
|
opts: {
|
|
12125
12129
|
|
|
12126
12130
|
|
|
12127
|
-
advancedflow:
|
|
12131
|
+
advancedflow: *,
|
|
12128
12132
|
|
|
12129
12133
|
|
|
12130
12134
|
},
|
|
@@ -12190,7 +12194,7 @@
|
|
|
12190
12194
|
|
|
12191
12195
|
|
|
12192
12196
|
|
|
12193
|
-
flowfolder:
|
|
12197
|
+
flowfolder: *,
|
|
12194
12198
|
|
|
12195
12199
|
|
|
12196
12200
|
},
|
|
@@ -12209,7 +12213,7 @@
|
|
|
12209
12213
|
opts: {
|
|
12210
12214
|
|
|
12211
12215
|
|
|
12212
|
-
flowfolder:
|
|
12216
|
+
flowfolder: *,
|
|
12213
12217
|
|
|
12214
12218
|
|
|
12215
12219
|
},
|
|
@@ -12256,7 +12260,7 @@
|
|
|
12256
12260
|
|
|
12257
12261
|
|
|
12258
12262
|
|
|
12259
|
-
state:
|
|
12263
|
+
state: *,
|
|
12260
12264
|
|
|
12261
12265
|
|
|
12262
12266
|
},
|
|
@@ -12283,7 +12287,7 @@
|
|
|
12283
12287
|
|
|
12284
12288
|
|
|
12285
12289
|
|
|
12286
|
-
flow:
|
|
12290
|
+
flow: *,
|
|
12287
12291
|
|
|
12288
12292
|
|
|
12289
12293
|
},
|
|
@@ -12325,7 +12329,7 @@
|
|
|
12325
12329
|
|
|
12326
12330
|
|
|
12327
12331
|
|
|
12328
|
-
flow:
|
|
12332
|
+
flow: *,
|
|
12329
12333
|
|
|
12330
12334
|
|
|
12331
12335
|
},
|
|
@@ -12344,7 +12348,7 @@
|
|
|
12344
12348
|
opts: {
|
|
12345
12349
|
|
|
12346
12350
|
|
|
12347
|
-
flow:
|
|
12351
|
+
flow: *,
|
|
12348
12352
|
|
|
12349
12353
|
|
|
12350
12354
|
},
|
|
@@ -13034,7 +13038,7 @@
|
|
|
13034
13038
|
|
|
13035
13039
|
|
|
13036
13040
|
|
|
13037
|
-
log:
|
|
13041
|
+
log: *,
|
|
13038
13042
|
|
|
13039
13043
|
|
|
13040
13044
|
},
|
|
@@ -13241,7 +13245,7 @@
|
|
|
13241
13245
|
|
|
13242
13246
|
|
|
13243
13247
|
|
|
13244
|
-
variable:
|
|
13248
|
+
variable: *,
|
|
13245
13249
|
|
|
13246
13250
|
|
|
13247
13251
|
},
|
|
@@ -13260,7 +13264,7 @@
|
|
|
13260
13264
|
opts: {
|
|
13261
13265
|
|
|
13262
13266
|
|
|
13263
|
-
variable:
|
|
13267
|
+
variable: *,
|
|
13264
13268
|
|
|
13265
13269
|
|
|
13266
13270
|
},
|
|
@@ -13358,7 +13362,7 @@
|
|
|
13358
13362
|
|
|
13359
13363
|
|
|
13360
13364
|
|
|
13361
|
-
state:
|
|
13365
|
+
state: *,
|
|
13362
13366
|
|
|
13363
13367
|
|
|
13364
13368
|
},
|
|
@@ -13400,7 +13404,7 @@
|
|
|
13400
13404
|
|
|
13401
13405
|
|
|
13402
13406
|
|
|
13403
|
-
mood:
|
|
13407
|
+
mood: *,
|
|
13404
13408
|
|
|
13405
13409
|
|
|
13406
13410
|
},
|
|
@@ -13419,7 +13423,7 @@
|
|
|
13419
13423
|
opts: {
|
|
13420
13424
|
|
|
13421
13425
|
|
|
13422
|
-
mood:
|
|
13426
|
+
mood: *,
|
|
13423
13427
|
|
|
13424
13428
|
|
|
13425
13429
|
},
|
|
@@ -13644,7 +13648,7 @@
|
|
|
13644
13648
|
|
|
13645
13649
|
|
|
13646
13650
|
|
|
13647
|
-
value:
|
|
13651
|
+
value: *,
|
|
13648
13652
|
|
|
13649
13653
|
|
|
13650
13654
|
},
|
|
@@ -13663,11 +13667,11 @@
|
|
|
13663
13667
|
opts: {
|
|
13664
13668
|
|
|
13665
13669
|
|
|
13666
|
-
opts:
|
|
13670
|
+
opts: *,
|
|
13667
13671
|
|
|
13668
13672
|
|
|
13669
13673
|
|
|
13670
|
-
value:
|
|
13674
|
+
value: *,
|
|
13671
13675
|
|
|
13672
13676
|
|
|
13673
13677
|
},
|
|
@@ -13709,7 +13713,7 @@
|
|
|
13709
13713
|
|
|
13710
13714
|
|
|
13711
13715
|
|
|
13712
|
-
value:
|
|
13716
|
+
value: *,
|
|
13713
13717
|
|
|
13714
13718
|
|
|
13715
13719
|
},
|
|
@@ -13728,11 +13732,11 @@
|
|
|
13728
13732
|
opts: {
|
|
13729
13733
|
|
|
13730
13734
|
|
|
13731
|
-
opts:
|
|
13735
|
+
opts: *,
|
|
13732
13736
|
|
|
13733
13737
|
|
|
13734
13738
|
|
|
13735
|
-
value:
|
|
13739
|
+
value: *,
|
|
13736
13740
|
|
|
13737
13741
|
|
|
13738
13742
|
},
|
|
@@ -13867,7 +13871,7 @@
|
|
|
13867
13871
|
|
|
13868
13872
|
|
|
13869
13873
|
|
|
13870
|
-
data:
|
|
13874
|
+
data: *,
|
|
13871
13875
|
|
|
13872
13876
|
|
|
13873
13877
|
},
|
|
@@ -14621,7 +14625,7 @@
|
|
|
14621
14625
|
|
|
14622
14626
|
|
|
14623
14627
|
|
|
14624
|
-
user:
|
|
14628
|
+
user: *,
|
|
14625
14629
|
|
|
14626
14630
|
|
|
14627
14631
|
},
|
|
@@ -14640,11 +14644,11 @@
|
|
|
14640
14644
|
opts: {
|
|
14641
14645
|
|
|
14642
14646
|
|
|
14643
|
-
email:
|
|
14647
|
+
email: *,
|
|
14644
14648
|
|
|
14645
14649
|
|
|
14646
14650
|
|
|
14647
|
-
name:
|
|
14651
|
+
name: *,
|
|
14648
14652
|
|
|
14649
14653
|
|
|
14650
14654
|
},
|
|
@@ -14663,7 +14667,7 @@
|
|
|
14663
14667
|
opts: {
|
|
14664
14668
|
|
|
14665
14669
|
|
|
14666
|
-
user:
|
|
14670
|
+
user: *,
|
|
14667
14671
|
|
|
14668
14672
|
|
|
14669
14673
|
},
|
|
@@ -14855,7 +14859,7 @@
|
|
|
14855
14859
|
|
|
14856
14860
|
|
|
14857
14861
|
|
|
14858
|
-
zone:
|
|
14862
|
+
zone: *,
|
|
14859
14863
|
|
|
14860
14864
|
|
|
14861
14865
|
},
|
|
@@ -14874,7 +14878,7 @@
|
|
|
14874
14878
|
opts: {
|
|
14875
14879
|
|
|
14876
14880
|
|
|
14877
|
-
zone:
|
|
14881
|
+
zone: *,
|
|
14878
14882
|
|
|
14879
14883
|
|
|
14880
14884
|
},
|
|
@@ -15097,7 +15101,5 @@
|
|
|
15097
15101
|
|
|
15098
15102
|
|
|
15099
15103
|
|
|
15100
|
-
|
|
15101
|
-
|
|
15102
15104
|
|
|
15103
15105
|
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const APIError = require('
|
|
3
|
+
const APIError = require('./APIError');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Thrown when Homey is unreachable.
|
|
7
7
|
* @class
|
|
8
8
|
* @hideconstructor
|
|
9
9
|
* @extends APIError
|
|
10
|
-
* @memberof HomeyAPI
|
|
11
10
|
*/
|
|
12
|
-
class
|
|
11
|
+
class APIErrorHomeyOffline extends APIError {
|
|
13
12
|
|
|
14
13
|
constructor(err) {
|
|
15
14
|
if (err instanceof Error) {
|
|
@@ -21,4 +20,4 @@ class HomeyOfflineError extends APIError {
|
|
|
21
20
|
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
module.exports =
|
|
23
|
+
module.exports = APIErrorHomeyOffline;
|
package/lib/APIErrorTimeout.js
CHANGED
|
@@ -7,7 +7,7 @@ const ManagerApps = require('./HomeyAPIV2/ManagerApps');
|
|
|
7
7
|
const ManagerDevices = require('./HomeyAPIV2/ManagerDevices');
|
|
8
8
|
const HomeyAPI = require('./HomeyAPI');
|
|
9
9
|
const HomeyAPIError = require('./HomeyAPIError');
|
|
10
|
-
const
|
|
10
|
+
const APIErrorHomeyOffline = require('../APIErrorHomeyOffline');
|
|
11
11
|
const Util = require('../Util');
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -292,13 +292,13 @@ class HomeyAPIV2 extends HomeyAPI {
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
if (!promises.length) {
|
|
295
|
-
throw new
|
|
295
|
+
throw new APIErrorHomeyOffline();
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
return
|
|
298
|
+
return Util.promiseAny(promises);
|
|
299
299
|
})
|
|
300
300
|
.then(result => resolve(result))
|
|
301
|
-
.catch(
|
|
301
|
+
.catch(() => reject(new APIErrorHomeyOffline()));
|
|
302
302
|
} else if (pings[HomeyAPI.DISCOVERY_STRATEGIES.LOCAL]) {
|
|
303
303
|
pings[HomeyAPI.DISCOVERY_STRATEGIES.LOCAL]
|
|
304
304
|
.then(result => resolve(result))
|
|
@@ -306,7 +306,7 @@ class HomeyAPIV2 extends HomeyAPI {
|
|
|
306
306
|
if (pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]) {
|
|
307
307
|
pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]
|
|
308
308
|
.then(result => resolve(result))
|
|
309
|
-
.catch(err => reject(new
|
|
309
|
+
.catch(err => reject(new APIErrorHomeyOffline(err)));
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
} else if (pings[HomeyAPI.DISCOVERY_STRATEGIES.MDNS]) {
|
|
@@ -316,15 +316,15 @@ class HomeyAPIV2 extends HomeyAPI {
|
|
|
316
316
|
if (pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]) {
|
|
317
317
|
pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]
|
|
318
318
|
.then(result => resolve(result))
|
|
319
|
-
.catch(err => reject(new
|
|
319
|
+
.catch(err => reject(new APIErrorHomeyOffline(err)));
|
|
320
320
|
}
|
|
321
321
|
});
|
|
322
322
|
} else if (pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]) {
|
|
323
323
|
pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]
|
|
324
324
|
.then(result => resolve(result))
|
|
325
|
-
.catch(err => reject(new
|
|
325
|
+
.catch(err => reject(new APIErrorHomeyOffline(err)));
|
|
326
326
|
} else {
|
|
327
|
-
reject(new
|
|
327
|
+
reject(new APIErrorHomeyOffline());
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
return promise;
|
package/lib/Util.js
CHANGED
|
@@ -172,6 +172,29 @@ class Util {
|
|
|
172
172
|
.toUpperCase();
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
/**
|
|
176
|
+
* Polyfill for Promise.any, which is only supported on Node.js >=15
|
|
177
|
+
* @param {Array<Promise>} promises
|
|
178
|
+
*/
|
|
179
|
+
static async promiseAny(promises) {
|
|
180
|
+
if (promises.length === 0) return;
|
|
181
|
+
const rejections = [];
|
|
182
|
+
|
|
183
|
+
return new Promise((resolve, reject) => {
|
|
184
|
+
promises.forEach((promise, i) => {
|
|
185
|
+
promise
|
|
186
|
+
.then(result => resolve(result))
|
|
187
|
+
.catch(err => {
|
|
188
|
+
rejections[i] = err;
|
|
189
|
+
|
|
190
|
+
if (rejections.length === promises.length) {
|
|
191
|
+
reject(rejections);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
175
198
|
}
|
|
176
199
|
|
|
177
200
|
module.exports = Util;
|