homey-api 3.15.0 → 3.16.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.
@@ -2,319 +2,11 @@
2
2
  "host": "store-api.athom.com",
3
3
  "basePath": "/api",
4
4
  "operations": {
5
- "getProducts": {
6
- "path": "/store/product",
7
- "method": "get",
8
- "parameters": {}
9
- },
10
- "getProduct": {
11
- "path": "/store/product/{productId}",
12
- "method": "get",
13
- "parameters": {
14
- "productId": {
15
- "in": "path",
16
- "type": "string",
17
- "required": true
18
- }
19
- }
20
- },
21
- "getCart": {
22
- "path": "/store/cart",
23
- "method": "get",
24
- "parameters": {}
25
- },
26
- "addProductToCart": {
27
- "path": "/store/cart",
28
- "method": "post",
29
- "parameters": {
30
- "sku": {
31
- "type": "string",
32
- "in": "body"
33
- },
34
- "quantity": {
35
- "type": "number",
36
- "in": "body"
37
- },
38
- "options": {
39
- "type": "object",
40
- "in": "body"
41
- }
42
- }
43
- },
44
- "setCartProductQuantity": {
45
- "path": "/store/cart",
46
- "method": "put",
47
- "parameters": {
48
- "sku": {
49
- "type": "string",
50
- "in": "body"
51
- },
52
- "quantity": {
53
- "type": "number",
54
- "in": "body"
55
- }
56
- }
57
- },
58
- "removeProductFromCart": {
59
- "path": "/store/cart",
60
- "method": "delete",
61
- "parameters": {
62
- "sku": {
63
- "type": "string",
64
- "in": "body"
65
- }
66
- }
67
- },
68
- "getLocales": {
69
- "path": "/store/locale",
70
- "method": "get",
71
- "parameters": {}
72
- },
73
- "setLocale": {
74
- "path": "/store/locale",
75
- "method": "put",
76
- "parameters": {
77
- "locale": {
78
- "type": "string",
79
- "in": "body"
80
- }
81
- }
82
- },
83
- "setUserdata": {
84
- "path": "/store/userdata",
85
- "method": "put",
86
- "parameters": {
87
- "shipping_address": {
88
- "type": "boolean",
89
- "in": "body"
90
- },
91
- "create_account": {
92
- "type": "boolean",
93
- "in": "body"
94
- },
95
- "newsletter": {
96
- "type": "boolean",
97
- "in": "body"
98
- },
99
- "is_business": {
100
- "type": "boolean",
101
- "in": "body"
102
- },
103
- "email": {
104
- "type": "string",
105
- "in": "body"
106
- },
107
- "password": {
108
- "type": "string",
109
- "in": "body"
110
- },
111
- "gender": {
112
- "type": "string",
113
- "in": "body"
114
- },
115
- "phone": {
116
- "type": "string",
117
- "in": "body"
118
- },
119
- "billing_firstname": {
120
- "type": "string",
121
- "in": "body"
122
- },
123
- "billing_lastname": {
124
- "type": "string",
125
- "in": "body"
126
- },
127
- "billing_street": {
128
- "type": "string",
129
- "in": "body"
130
- },
131
- "billing_number": {
132
- "type": "string",
133
- "in": "body"
134
- },
135
- "billing_zipcode": {
136
- "type": "string",
137
- "in": "body"
138
- },
139
- "billing_city": {
140
- "type": "string",
141
- "in": "body"
142
- },
143
- "billing_state": {
144
- "type": "string",
145
- "in": "body"
146
- },
147
- "billing_country": {
148
- "type": "string",
149
- "in": "body"
150
- },
151
- "billing_address_extra": {
152
- "type": "string",
153
- "in": "body"
154
- },
155
- "shipping_firstname": {
156
- "type": "string",
157
- "in": "body"
158
- },
159
- "shipping_lastname": {
160
- "type": "string",
161
- "in": "body"
162
- },
163
- "shipping_street": {
164
- "type": "string",
165
- "in": "body"
166
- },
167
- "shipping_number": {
168
- "type": "string",
169
- "in": "body"
170
- },
171
- "shipping_zipcode": {
172
- "type": "string",
173
- "in": "body"
174
- },
175
- "shipping_city": {
176
- "type": "string",
177
- "in": "body"
178
- },
179
- "shipping_state": {
180
- "type": "string",
181
- "in": "body"
182
- },
183
- "shipping_country": {
184
- "type": "string",
185
- "in": "body"
186
- },
187
- "shipping_address_extra": {
188
- "type": "string",
189
- "in": "body"
190
- },
191
- "business_name": {
192
- "type": "string",
193
- "in": "body"
194
- },
195
- "business_vat": {
196
- "type": "string",
197
- "in": "body"
198
- },
199
- "business_reference": {
200
- "type": "string",
201
- "in": "body"
202
- }
203
- }
204
- },
205
- "setBusiness": {
206
- "path": "/store/business",
207
- "method": "put",
208
- "parameters": {
209
- "business": {
210
- "type": "boolean",
211
- "in": "body"
212
- }
213
- }
214
- },
215
- "setCoupon": {
216
- "path": "/store/coupon",
217
- "method": "put",
218
- "parameters": {
219
- "coupon": {
220
- "type": "string",
221
- "in": "body"
222
- }
223
- }
224
- },
225
- "setPayment": {
226
- "path": "/store/payment",
227
- "method": "put",
228
- "parameters": {
229
- "payment": {
230
- "type": "string",
231
- "in": "body"
232
- }
233
- }
234
- },
235
- "createOrder": {
236
- "path": "/store/order",
237
- "method": "post",
238
- "parameters": {}
239
- },
240
- "payOrder": {
241
- "path": "/store/order/pay",
242
- "method": "post",
243
- "parameters": {
244
- "orderId": {
245
- "type": "string",
246
- "in": "body"
247
- }
248
- }
249
- },
250
- "validateVat": {
251
- "path": "/store/vat",
252
- "method": "get",
253
- "parameters": {
254
- "vat": {
255
- "in": "query",
256
- "type": "string",
257
- "required": true
258
- }
259
- }
260
- },
261
- "getAddressSuggestion": {
262
- "path": "/util/zipcode",
263
- "method": "get",
264
- "parameters": {
265
- "zipcode": {
266
- "in": "query",
267
- "type": "string",
268
- "required": true
269
- },
270
- "number": {
271
- "in": "query",
272
- "type": "number",
273
- "required": true
274
- }
275
- }
276
- },
277
- "createSession": {
278
- "path": "/user/session",
279
- "method": "post",
280
- "parameters": {}
281
- },
282
- "deleteSession": {
283
- "path": "/user/session",
284
- "method": "delete",
285
- "parameters": {}
286
- },
287
5
  "getOrders": {
288
6
  "path": "/user/order",
289
7
  "method": "get",
290
8
  "parameters": {}
291
9
  },
292
- "getOrder": {
293
- "path": "/user/order/{orderId}",
294
- "method": "get",
295
- "parameters": {
296
- "orderId": {
297
- "in": "path",
298
- "type": "string",
299
- "required": true
300
- }
301
- }
302
- },
303
- "loginByDelegationToken": {
304
- "path": "/user/login-token",
305
- "method": "post",
306
- "parameters": {
307
- "token": {
308
- "type": "string",
309
- "in": "body"
310
- }
311
- }
312
- },
313
- "logout": {
314
- "path": "/user/logout",
315
- "method": "post",
316
- "parameters": {}
317
- },
318
10
  "verifySubscription": {
319
11
  "path": "/subscription/verify",
320
12
  "method": "post",
@@ -396,6 +396,10 @@
396
396
  "homey.app"
397
397
  ],
398
398
  "parameters": {
399
+ "version": {
400
+ "in": "body",
401
+ "type": "string"
402
+ },
399
403
  "channel": {
400
404
  "in": "body",
401
405
  "type": "string"
@@ -4550,6 +4554,9 @@
4550
4554
  "settings": {
4551
4555
  "type": "object"
4552
4556
  },
4557
+ "devices": {
4558
+ "type": "object"
4559
+ },
4553
4560
  "height": {
4554
4561
  "type": [
4555
4562
  "number",
@@ -4558,6 +4565,9 @@
4558
4565
  },
4559
4566
  "transparent": {
4560
4567
  "type": "boolean"
4568
+ },
4569
+ "deprecated": {
4570
+ "type": "boolean"
4561
4571
  }
4562
4572
  },
4563
4573
  "x-realtime-bindings": {
@@ -6163,15 +6173,6 @@
6163
6173
  "homey.geolocation.readonly"
6164
6174
  ],
6165
6175
  "parameters": {}
6166
- },
6167
- "getWeatherHourly": {
6168
- "method": "get",
6169
- "path": "/forecast/hourly",
6170
- "private": false,
6171
- "scopes": [
6172
- "homey.geolocation.readonly"
6173
- ],
6174
- "parameters": {}
6175
6176
  }
6176
6177
  }
6177
6178
  },
@@ -148,9 +148,13 @@ export namespace HomeyAPIV2.ManagerDashboards {
148
148
 
149
149
  settings: object;
150
150
 
151
+ devices: object;
152
+
151
153
  height: number | string;
152
154
 
153
155
  transparent: boolean;
156
+
157
+ deprecated: boolean;
154
158
  }
155
159
 
156
160
  export class Dashboard extends HomeyAPIV3Local.ManagerDashboards.Dashboard {
@@ -5180,122 +5184,8 @@ export class AthomStoreAPI {
5180
5184
  secret?: string;
5181
5185
  });
5182
5186
 
5183
- getProducts(): Promise<any>;
5184
-
5185
- getProduct(opts: { productId: string }): Promise<any>;
5186
-
5187
- getCart(): Promise<any>;
5188
-
5189
- addProductToCart(opts: {
5190
- sku?: string;
5191
-
5192
- quantity?: number;
5193
-
5194
- options?: object;
5195
- }): Promise<any>;
5196
-
5197
- setCartProductQuantity(opts: {
5198
- sku?: string;
5199
-
5200
- quantity?: number;
5201
- }): Promise<any>;
5202
-
5203
- removeProductFromCart(opts: { sku?: string }): Promise<any>;
5204
-
5205
- getLocales(): Promise<any>;
5206
-
5207
- setLocale(opts: { locale?: string }): Promise<any>;
5208
-
5209
- setUserdata(opts: {
5210
- shipping_address?: boolean;
5211
-
5212
- create_account?: boolean;
5213
-
5214
- newsletter?: boolean;
5215
-
5216
- is_business?: boolean;
5217
-
5218
- email?: string;
5219
-
5220
- password?: string;
5221
-
5222
- gender?: string;
5223
-
5224
- phone?: string;
5225
-
5226
- billing_firstname?: string;
5227
-
5228
- billing_lastname?: string;
5229
-
5230
- billing_street?: string;
5231
-
5232
- billing_number?: string;
5233
-
5234
- billing_zipcode?: string;
5235
-
5236
- billing_city?: string;
5237
-
5238
- billing_state?: string;
5239
-
5240
- billing_country?: string;
5241
-
5242
- billing_address_extra?: string;
5243
-
5244
- shipping_firstname?: string;
5245
-
5246
- shipping_lastname?: string;
5247
-
5248
- shipping_street?: string;
5249
-
5250
- shipping_number?: string;
5251
-
5252
- shipping_zipcode?: string;
5253
-
5254
- shipping_city?: string;
5255
-
5256
- shipping_state?: string;
5257
-
5258
- shipping_country?: string;
5259
-
5260
- shipping_address_extra?: string;
5261
-
5262
- business_name?: string;
5263
-
5264
- business_vat?: string;
5265
-
5266
- business_reference?: string;
5267
- }): Promise<any>;
5268
-
5269
- setBusiness(opts: { business?: boolean }): Promise<any>;
5270
-
5271
- setCoupon(opts: { coupon?: string }): Promise<any>;
5272
-
5273
- setPayment(opts: { payment?: string }): Promise<any>;
5274
-
5275
- createOrder(): Promise<any>;
5276
-
5277
- payOrder(opts: { orderId?: string }): Promise<any>;
5278
-
5279
- validateVat(opts: { vat: string }): Promise<any>;
5280
-
5281
- getAddressSuggestion(opts: {
5282
- zipcode: string;
5283
-
5284
- number: number;
5285
- }): Promise<any>;
5286
-
5287
- createSession(): Promise<any>;
5288
-
5289
- deleteSession(): Promise<any>;
5290
-
5291
5187
  getOrders(): Promise<any>;
5292
5188
 
5293
- getOrder(opts: { orderId: string }): Promise<any>;
5294
-
5295
- loginByDelegationToken(opts: { token?: string }): Promise<any>;
5296
-
5297
- logout(): Promise<any>;
5298
-
5299
5189
  verifySubscription(opts: {
5300
5190
  token?: string;
5301
5191
 
@@ -5408,122 +5298,8 @@ export class AthomStoreAPI {
5408
5298
 
5409
5299
  redeemCoupon(opts: { couponCode: string }): Promise<any>;
5410
5300
 
5411
- getProducts(): Promise<any>;
5412
-
5413
- getProduct(opts: { productId: string }): Promise<any>;
5414
-
5415
- getCart(): Promise<any>;
5416
-
5417
- addProductToCart(opts: {
5418
- sku?: string;
5419
-
5420
- quantity?: number;
5421
-
5422
- options?: object;
5423
- }): Promise<any>;
5424
-
5425
- setCartProductQuantity(opts: {
5426
- sku?: string;
5427
-
5428
- quantity?: number;
5429
- }): Promise<any>;
5430
-
5431
- removeProductFromCart(opts: { sku?: string }): Promise<any>;
5432
-
5433
- getLocales(): Promise<any>;
5434
-
5435
- setLocale(opts: { locale?: string }): Promise<any>;
5436
-
5437
- setUserdata(opts: {
5438
- shipping_address?: boolean;
5439
-
5440
- create_account?: boolean;
5441
-
5442
- newsletter?: boolean;
5443
-
5444
- is_business?: boolean;
5445
-
5446
- email?: string;
5447
-
5448
- password?: string;
5449
-
5450
- gender?: string;
5451
-
5452
- phone?: string;
5453
-
5454
- billing_firstname?: string;
5455
-
5456
- billing_lastname?: string;
5457
-
5458
- billing_street?: string;
5459
-
5460
- billing_number?: string;
5461
-
5462
- billing_zipcode?: string;
5463
-
5464
- billing_city?: string;
5465
-
5466
- billing_state?: string;
5467
-
5468
- billing_country?: string;
5469
-
5470
- billing_address_extra?: string;
5471
-
5472
- shipping_firstname?: string;
5473
-
5474
- shipping_lastname?: string;
5475
-
5476
- shipping_street?: string;
5477
-
5478
- shipping_number?: string;
5479
-
5480
- shipping_zipcode?: string;
5481
-
5482
- shipping_city?: string;
5483
-
5484
- shipping_state?: string;
5485
-
5486
- shipping_country?: string;
5487
-
5488
- shipping_address_extra?: string;
5489
-
5490
- business_name?: string;
5491
-
5492
- business_vat?: string;
5493
-
5494
- business_reference?: string;
5495
- }): Promise<any>;
5496
-
5497
- setBusiness(opts: { business?: boolean }): Promise<any>;
5498
-
5499
- setCoupon(opts: { coupon?: string }): Promise<any>;
5500
-
5501
- setPayment(opts: { payment?: string }): Promise<any>;
5502
-
5503
- createOrder(): Promise<any>;
5504
-
5505
- payOrder(opts: { orderId?: string }): Promise<any>;
5506
-
5507
- validateVat(opts: { vat: string }): Promise<any>;
5508
-
5509
- getAddressSuggestion(opts: {
5510
- zipcode: string;
5511
-
5512
- number: number;
5513
- }): Promise<any>;
5514
-
5515
- createSession(): Promise<any>;
5516
-
5517
- deleteSession(): Promise<any>;
5518
-
5519
5301
  getOrders(): Promise<any>;
5520
5302
 
5521
- getOrder(opts: { orderId: string }): Promise<any>;
5522
-
5523
- loginByDelegationToken(opts: { token?: string }): Promise<any>;
5524
-
5525
- logout(): Promise<any>;
5526
-
5527
5303
  verifySubscription(opts: {
5528
5304
  token?: string;
5529
5305
 
@@ -8902,122 +8678,8 @@ export class AthomStoreAPI {
8902
8678
  secret?: string;
8903
8679
  });
8904
8680
 
8905
- getProducts(): Promise<any>;
8906
-
8907
- getProduct(opts: { productId: string }): Promise<any>;
8908
-
8909
- getCart(): Promise<any>;
8910
-
8911
- addProductToCart(opts: {
8912
- sku?: string;
8913
-
8914
- quantity?: number;
8915
-
8916
- options?: object;
8917
- }): Promise<any>;
8918
-
8919
- setCartProductQuantity(opts: {
8920
- sku?: string;
8921
-
8922
- quantity?: number;
8923
- }): Promise<any>;
8924
-
8925
- removeProductFromCart(opts: { sku?: string }): Promise<any>;
8926
-
8927
- getLocales(): Promise<any>;
8928
-
8929
- setLocale(opts: { locale?: string }): Promise<any>;
8930
-
8931
- setUserdata(opts: {
8932
- shipping_address?: boolean;
8933
-
8934
- create_account?: boolean;
8935
-
8936
- newsletter?: boolean;
8937
-
8938
- is_business?: boolean;
8939
-
8940
- email?: string;
8941
-
8942
- password?: string;
8943
-
8944
- gender?: string;
8945
-
8946
- phone?: string;
8947
-
8948
- billing_firstname?: string;
8949
-
8950
- billing_lastname?: string;
8951
-
8952
- billing_street?: string;
8953
-
8954
- billing_number?: string;
8955
-
8956
- billing_zipcode?: string;
8957
-
8958
- billing_city?: string;
8959
-
8960
- billing_state?: string;
8961
-
8962
- billing_country?: string;
8963
-
8964
- billing_address_extra?: string;
8965
-
8966
- shipping_firstname?: string;
8967
-
8968
- shipping_lastname?: string;
8969
-
8970
- shipping_street?: string;
8971
-
8972
- shipping_number?: string;
8973
-
8974
- shipping_zipcode?: string;
8975
-
8976
- shipping_city?: string;
8977
-
8978
- shipping_state?: string;
8979
-
8980
- shipping_country?: string;
8981
-
8982
- shipping_address_extra?: string;
8983
-
8984
- business_name?: string;
8985
-
8986
- business_vat?: string;
8987
-
8988
- business_reference?: string;
8989
- }): Promise<any>;
8990
-
8991
- setBusiness(opts: { business?: boolean }): Promise<any>;
8992
-
8993
- setCoupon(opts: { coupon?: string }): Promise<any>;
8994
-
8995
- setPayment(opts: { payment?: string }): Promise<any>;
8996
-
8997
- createOrder(): Promise<any>;
8998
-
8999
- payOrder(opts: { orderId?: string }): Promise<any>;
9000
-
9001
- validateVat(opts: { vat: string }): Promise<any>;
9002
-
9003
- getAddressSuggestion(opts: {
9004
- zipcode: string;
9005
-
9006
- number: number;
9007
- }): Promise<any>;
9008
-
9009
- createSession(): Promise<any>;
9010
-
9011
- deleteSession(): Promise<any>;
9012
-
9013
8681
  getOrders(): Promise<any>;
9014
8682
 
9015
- getOrder(opts: { orderId: string }): Promise<any>;
9016
-
9017
- loginByDelegationToken(opts: { token?: string }): Promise<any>;
9018
-
9019
- logout(): Promise<any>;
9020
-
9021
8683
  verifySubscription(opts: {
9022
8684
  token?: string;
9023
8685
 
@@ -9130,122 +8792,8 @@ export class AthomStoreAPI {
9130
8792
 
9131
8793
  redeemCoupon(opts: { couponCode: string }): Promise<any>;
9132
8794
 
9133
- getProducts(): Promise<any>;
9134
-
9135
- getProduct(opts: { productId: string }): Promise<any>;
9136
-
9137
- getCart(): Promise<any>;
9138
-
9139
- addProductToCart(opts: {
9140
- sku?: string;
9141
-
9142
- quantity?: number;
9143
-
9144
- options?: object;
9145
- }): Promise<any>;
9146
-
9147
- setCartProductQuantity(opts: {
9148
- sku?: string;
9149
-
9150
- quantity?: number;
9151
- }): Promise<any>;
9152
-
9153
- removeProductFromCart(opts: { sku?: string }): Promise<any>;
9154
-
9155
- getLocales(): Promise<any>;
9156
-
9157
- setLocale(opts: { locale?: string }): Promise<any>;
9158
-
9159
- setUserdata(opts: {
9160
- shipping_address?: boolean;
9161
-
9162
- create_account?: boolean;
9163
-
9164
- newsletter?: boolean;
9165
-
9166
- is_business?: boolean;
9167
-
9168
- email?: string;
9169
-
9170
- password?: string;
9171
-
9172
- gender?: string;
9173
-
9174
- phone?: string;
9175
-
9176
- billing_firstname?: string;
9177
-
9178
- billing_lastname?: string;
9179
-
9180
- billing_street?: string;
9181
-
9182
- billing_number?: string;
9183
-
9184
- billing_zipcode?: string;
9185
-
9186
- billing_city?: string;
9187
-
9188
- billing_state?: string;
9189
-
9190
- billing_country?: string;
9191
-
9192
- billing_address_extra?: string;
9193
-
9194
- shipping_firstname?: string;
9195
-
9196
- shipping_lastname?: string;
9197
-
9198
- shipping_street?: string;
9199
-
9200
- shipping_number?: string;
9201
-
9202
- shipping_zipcode?: string;
9203
-
9204
- shipping_city?: string;
9205
-
9206
- shipping_state?: string;
9207
-
9208
- shipping_country?: string;
9209
-
9210
- shipping_address_extra?: string;
9211
-
9212
- business_name?: string;
9213
-
9214
- business_vat?: string;
9215
-
9216
- business_reference?: string;
9217
- }): Promise<any>;
9218
-
9219
- setBusiness(opts: { business?: boolean }): Promise<any>;
9220
-
9221
- setCoupon(opts: { coupon?: string }): Promise<any>;
9222
-
9223
- setPayment(opts: { payment?: string }): Promise<any>;
9224
-
9225
- createOrder(): Promise<any>;
9226
-
9227
- payOrder(opts: { orderId?: string }): Promise<any>;
9228
-
9229
- validateVat(opts: { vat: string }): Promise<any>;
9230
-
9231
- getAddressSuggestion(opts: {
9232
- zipcode: string;
9233
-
9234
- number: number;
9235
- }): Promise<any>;
9236
-
9237
- createSession(): Promise<any>;
9238
-
9239
- deleteSession(): Promise<any>;
9240
-
9241
8795
  getOrders(): Promise<any>;
9242
8796
 
9243
- getOrder(opts: { orderId: string }): Promise<any>;
9244
-
9245
- loginByDelegationToken(opts: { token?: string }): Promise<any>;
9246
-
9247
- logout(): Promise<any>;
9248
-
9249
8797
  verifySubscription(opts: {
9250
8798
  token?: string;
9251
8799
 
@@ -90,6 +90,7 @@ class HomeyAPI extends EventEmitter {
90
90
  value: properties.softwareVersion ?? null,
91
91
  enumerable: true,
92
92
  writable: true,
93
+ configurable: true,
93
94
  });
94
95
 
95
96
  // Set Name
@@ -228,20 +228,6 @@ class HomeyAPIV3 extends HomeyAPI {
228
228
  throw new Error('No Discovery Strategies Available');
229
229
  }
230
230
 
231
- // TODO
232
- // maybe we should always ping
233
-
234
- // Don't discover, just set the only strategy
235
- if (Object.keys(urls).length === 1) {
236
- this.__baseUrl = Object.values(urls)[0];
237
- this.__strategyId = Object.keys(urls)[0];
238
-
239
- return {
240
- baseUrl: this.__baseUrl,
241
- strategyId: this.__strategyId,
242
- };
243
- }
244
-
245
231
  this.__debug(`Discovery Strategies: ${Object.keys(urls).join(',')}`);
246
232
 
247
233
  // Create the returned Promise
@@ -448,7 +434,7 @@ class HomeyAPIV3 extends HomeyAPI {
448
434
  } else if (pings[HomeyAPI.DISCOVERY_STRATEGIES.LOCAL]) {
449
435
  pings[HomeyAPI.DISCOVERY_STRATEGIES.LOCAL]
450
436
  .then((result) => resolve(result))
451
- .catch(() => {
437
+ .catch((err) => {
452
438
  if (pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]) {
453
439
  pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]
454
440
  .then((result) => resolve(result))
@@ -463,12 +449,14 @@ class HomeyAPIV3 extends HomeyAPI {
463
449
 
464
450
  reject(new APIErrorHomeyOffline(err));
465
451
  });
452
+ } else {
453
+ reject(new APIErrorHomeyOffline(err));
466
454
  }
467
455
  });
468
456
  } else if (pings[HomeyAPI.DISCOVERY_STRATEGIES.MDNS]) {
469
457
  pings[HomeyAPI.DISCOVERY_STRATEGIES.MDNS]
470
458
  .then((result) => resolve(result))
471
- .catch(() => {
459
+ .catch((err) => {
472
460
  if (pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]) {
473
461
  pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]
474
462
  .then((result) => resolve(result))
@@ -483,12 +471,14 @@ class HomeyAPIV3 extends HomeyAPI {
483
471
 
484
472
  reject(new APIErrorHomeyOffline(err));
485
473
  });
474
+ } else {
475
+ reject(new APIErrorHomeyOffline(err));
486
476
  }
487
477
  });
488
478
  } else if (pings[HomeyAPI.DISCOVERY_STRATEGIES.REMOTE_FORWARDED]) {
489
479
  pings[HomeyAPI.DISCOVERY_STRATEGIES.REMOTE_FORWARDED]
490
480
  .then((result) => resolve(result))
491
- .catch(() => {
481
+ .catch((err) => {
492
482
  if (pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]) {
493
483
  pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]
494
484
  .then((result) => resolve(result))
@@ -503,6 +493,8 @@ class HomeyAPIV3 extends HomeyAPI {
503
493
 
504
494
  reject(new APIErrorHomeyOffline(err));
505
495
  });
496
+ } else {
497
+ reject(new APIErrorHomeyOffline(err));
506
498
  }
507
499
  });
508
500
  } else if (pings[HomeyAPI.DISCOVERY_STRATEGIES.CLOUD]) {
@@ -660,6 +652,7 @@ class HomeyAPIV3 extends HomeyAPI {
660
652
  this.__token = store.token;
661
653
  this.__session = store.session;
662
654
 
655
+ await this.baseUrl; // Ensure discovery has completed
663
656
  return;
664
657
  }
665
658
 
@@ -32,6 +32,11 @@ class HomeyAPIV3Cloud extends HomeyAPIV3 {
32
32
  strategy,
33
33
  ...props,
34
34
  });
35
+
36
+ // Seed the version cache with the initial value from the Cloud API,
37
+ // then remove the own data property so the prototype getter is used.
38
+ this.__versionCache[this.id] ??= this.version;
39
+ delete this.version;
35
40
  }
36
41
 
37
42
  get tier() {
@@ -42,6 +47,10 @@ class HomeyAPIV3Cloud extends HomeyAPIV3 {
42
47
  return this.__versionCache[this.id];
43
48
  }
44
49
 
50
+ set version(value) {
51
+ this.__versionCache[this.id] = value;
52
+ }
53
+
45
54
  get platform() {
46
55
  return 'cloud';
47
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homey-api",
3
- "version": "3.15.0",
3
+ "version": "3.16.1",
4
4
  "description": "Homey API",
5
5
  "main": "index.js",
6
6
  "license": "SEE LICENSE",
@@ -73,7 +73,7 @@
73
73
  "homey-api": "^3.0.8",
74
74
  "http-server": "^0.12.3",
75
75
  "jest": "^30.0.0-alpha.2",
76
- "jsdoc": "^4.0.2",
76
+ "jsdoc": "4.0.5",
77
77
  "jsdoc-to-markdown": "^8.0.0",
78
78
  "jsdoc-ts-utils": "^4.0.0",
79
79
  "jsdoc-tsimport-plugin": "^1.0.5",