homey-api 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -601,8 +601,8 @@
601
601
  "manufacturedAt": {
602
602
  "type": "string"
603
603
  },
604
- "activatedAt": {
605
- "type": "Date"
604
+ "activationHistory": {
605
+ "type": "array"
606
606
  }
607
607
  }
608
608
  }
@@ -647,13 +647,33 @@
647
647
  "manufacturedAt": {
648
648
  "type": "string"
649
649
  },
650
- "activatedAt": {
651
- "type": "Date"
650
+ "activationHistory": {
651
+ "type": "array"
652
652
  }
653
653
  }
654
654
  }
655
655
  }
656
656
  },
657
+ "activateBridge": {
658
+ "path": "/bridge/{serial}/activate",
659
+ "method": "post",
660
+ "private": true,
661
+ "parameters": {
662
+ "serial": {
663
+ "in": "path",
664
+ "type": "string",
665
+ "required": true
666
+ },
667
+ "homeyId": {
668
+ "type": "string",
669
+ "in": "body"
670
+ },
671
+ "userId": {
672
+ "type": "string",
673
+ "in": "body"
674
+ }
675
+ }
676
+ },
657
677
  "getHomeys": {
658
678
  "path": "/homey/",
659
679
  "method": "get",
@@ -700,7 +720,7 @@
700
720
  "type": "string"
701
721
  },
702
722
  "ipExternalPort": {
703
- "type": "Number"
723
+ "type": "number"
704
724
  },
705
725
  "localUrl": {
706
726
  "type": "string"
@@ -786,7 +806,7 @@
786
806
  "type": "string"
787
807
  },
788
808
  "ipExternalPort": {
789
- "type": "Number"
809
+ "type": "number"
790
810
  },
791
811
  "localUrl": {
792
812
  "type": "string"
@@ -2216,7 +2216,7 @@
2216
2216
 
2217
2217
 
2218
2218
 
2219
- activatedAt: Date,
2219
+ activationHistory: Array<any>,
2220
2220
 
2221
2221
 
2222
2222
  },
@@ -2280,7 +2280,7 @@
2280
2280
 
2281
2281
 
2282
2282
 
2283
- activatedAt: Date,
2283
+ activationHistory: Array<any>,
2284
2284
 
2285
2285
 
2286
2286
  },
@@ -2291,6 +2291,33 @@
2291
2291
 
2292
2292
 
2293
2293
 
2294
+ ):
2295
+ Promise<any>;
2296
+
2297
+ activateBridge(
2298
+
2299
+
2300
+
2301
+
2302
+ opts: {
2303
+
2304
+
2305
+ serial: string,
2306
+
2307
+
2308
+
2309
+ homeyId: string,
2310
+
2311
+
2312
+
2313
+ userId: string,
2314
+
2315
+
2316
+ },
2317
+
2318
+
2319
+
2320
+
2294
2321
  ):
2295
2322
  Promise<any>;
2296
2323
 
@@ -2352,7 +2379,7 @@
2352
2379
 
2353
2380
 
2354
2381
 
2355
- ipExternalPort: Number,
2382
+ ipExternalPort: number,
2356
2383
 
2357
2384
 
2358
2385
 
@@ -2468,7 +2495,7 @@
2468
2495
 
2469
2496
 
2470
2497
 
2471
- ipExternalPort: Number,
2498
+ ipExternalPort: number,
2472
2499
 
2473
2500
 
2474
2501
 
@@ -4154,86 +4181,6 @@
4154
4181
 
4155
4182
  getTimezone(
4156
4183
 
4157
- ):
4158
- Promise<any>;
4159
-
4160
- }
4161
-
4162
- export class AthomSignalsAPI {
4163
-
4164
- constructor(
4165
-
4166
-
4167
-
4168
-
4169
- opts: {
4170
-
4171
-
4172
- baseUrl: string,
4173
-
4174
-
4175
-
4176
- debug: boolean,
4177
-
4178
-
4179
-
4180
- secret: string,
4181
-
4182
-
4183
- },
4184
-
4185
-
4186
-
4187
-
4188
- )
4189
-
4190
-
4191
-
4192
-
4193
-
4194
- getSignals(
4195
-
4196
-
4197
-
4198
-
4199
- opts: {
4200
-
4201
-
4202
- brand: string,
4203
-
4204
-
4205
-
4206
- type: string,
4207
-
4208
-
4209
-
4210
- query: string,
4211
-
4212
-
4213
- },
4214
-
4215
-
4216
-
4217
-
4218
- ):
4219
- Promise<any>;
4220
-
4221
- getSignal(
4222
-
4223
-
4224
-
4225
-
4226
- opts: {
4227
-
4228
-
4229
- signalId: string,
4230
-
4231
-
4232
- },
4233
-
4234
-
4235
-
4236
-
4237
4184
  ):
4238
4185
  Promise<any>;
4239
4186
 
@@ -6062,8 +6009,6 @@
6062
6009
 
6063
6010
 
6064
6011
 
6065
-
6066
-
6067
6012
 
6068
6013
 
6069
6014
 
package/index.js CHANGED
@@ -16,7 +16,6 @@ module.exports = {
16
16
  AthomInfraredAPI: require('./lib/AthomInfraredAPI'),
17
17
  AthomNotificationsAPI: require('./lib/AthomNotificationsAPI'),
18
18
  AthomSetupAPI: require('./lib/AthomSetupAPI'),
19
- AthomSignalsAPI: require('./lib/AthomSignalsAPI'),
20
19
  AthomStoreAPI: require('./lib/AthomStoreAPI'),
21
20
  AthomWeatherAPI: require('./lib/AthomWeatherAPI'),
22
21
  AthomWebhooksAPI: require('./lib/AthomWebhooksAPI'),
@@ -308,9 +308,11 @@ class Manager extends EventEmitter {
308
308
  }
309
309
  case 'getAll': {
310
310
  // Add all to cache
311
+ const currentKeys = {};
311
312
  for (const [resultKey, item] of Object.entries(result)) {
312
313
  const key = getItemKey(item);
313
314
  const uri = getItemUri(item);
315
+ currentKeys[key] = true;
314
316
 
315
317
  if (this.__cache[itemId][key]) {
316
318
  result[resultKey] = this.__cache[itemId][key].__update(item);
@@ -334,7 +336,7 @@ class Manager extends EventEmitter {
334
336
  for (const cachedItem of Object.values(this.__cache[itemId])) {
335
337
  const key = getItemKey(cachedItem);
336
338
 
337
- if (!result[key]) {
339
+ if (!currentKeys[key]) {
338
340
  delete this.__cache[itemId][key];
339
341
  }
340
342
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homey-api",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Homey API",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -1,35 +0,0 @@
1
- {
2
- "host": "signals.athom.com",
3
- "basePath": "/api/",
4
- "operations": {
5
- "getSignals": {
6
- "path": "/prontohex/search",
7
- "method": "post",
8
- "parameters": {
9
- "brand": {
10
- "type": "string",
11
- "in": "body"
12
- },
13
- "type": {
14
- "type": "string",
15
- "in": "body"
16
- },
17
- "query": {
18
- "type": "string",
19
- "in": "body"
20
- }
21
- }
22
- },
23
- "getSignal": {
24
- "path": "/prontohex/{signalId}",
25
- "method": "get",
26
- "parameters": {
27
- "signalId": {
28
- "in": "path",
29
- "type": "string",
30
- "required": true
31
- }
32
- }
33
- }
34
- }
35
- }
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- const API = require('./API');
4
-
5
- class AthomSignalsAPI extends API {
6
-
7
- static SPECIFICATION = require('../assets/specifications/AthomSignalsAPI.json');
8
- static SPECIFICATION_URL = 'https://signals.athom.com/api/specification.json';
9
- static JSDOC_PRIVATE = true;
10
-
11
- }
12
-
13
- module.exports = AthomSignalsAPI;