@kohost/api-client 3.0.0-beta.31 → 3.0.0-beta.32

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.
@@ -137,7 +137,13 @@ var require_device = __commonJS({
137
137
  "lock",
138
138
  "courtesy",
139
139
  "sceneController",
140
- "gateway"
140
+ "gateway",
141
+ "tv",
142
+ "dvr",
143
+ "appleTv",
144
+ "discPlayer",
145
+ "mediaPlayer",
146
+ "uncontrolledDevice"
141
147
  ]
142
148
  },
143
149
  name: {
@@ -2421,6 +2427,7 @@ var require_room2 = __commonJS({
2421
2427
  "src/Models/room.js"(exports2, module2) {
2422
2428
  var schemas = require_schema();
2423
2429
  var schema = require_room();
2430
+ var deviceSchema = require_device();
2424
2431
  var Kohost = require_kohost();
2425
2432
  var cloneDeep = require("lodash.clonedeep");
2426
2433
  var Switch2 = require_switch2();
@@ -2442,21 +2449,18 @@ var require_room2 = __commonJS({
2442
2449
  super(roomData);
2443
2450
  }
2444
2451
  static getDevicePath(type) {
2445
- const validTypes = [
2446
- "dimmer",
2447
- "switch",
2448
- "thermostat",
2449
- "lock",
2450
- "windowCovering",
2451
- "courtesy",
2452
- "camera",
2453
- "mediaSource",
2454
- "motionSensor",
2455
- "alarm"
2456
- ];
2452
+ const validTypes = deviceSchema.definitions.type.enum;
2457
2453
  if (!validTypes.includes(type))
2458
2454
  throw new Error("Invalid device type:" + type);
2459
2455
  switch (type) {
2456
+ case "tv":
2457
+ case "dvr":
2458
+ case "appleTv":
2459
+ case "discPlayer":
2460
+ case "mediaPlayer":
2461
+ case "uncontrolledDevice":
2462
+ case "mediaSource":
2463
+ return "mediaSources";
2460
2464
  case "courtesy":
2461
2465
  return type;
2462
2466
  case "switch":
@@ -3436,19 +3440,7 @@ var require_discoveredDevice = __commonJS({
3436
3440
  type: "string"
3437
3441
  },
3438
3442
  type: {
3439
- type: "string",
3440
- enum: [
3441
- "dimmer",
3442
- "switch",
3443
- "motionSensor",
3444
- "thermostat",
3445
- "lock",
3446
- "camera",
3447
- "courtesy",
3448
- "mediaSource",
3449
- "alarm",
3450
- "windowCovering"
3451
- ]
3443
+ $ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/type"
3452
3444
  },
3453
3445
  driver: {
3454
3446
  type: "string"
package/dist/cjs/defs.js CHANGED
@@ -18,7 +18,8 @@ var require_deviceTypes = __commonJS({
18
18
  "alarm",
19
19
  "camera",
20
20
  "mediaSource",
21
- "motionSensor"
21
+ "motionSensor",
22
+ "gateway"
22
23
  ];
23
24
  module2.exports = types;
24
25
  }
package/dist/cjs/utils.js CHANGED
@@ -29,7 +29,8 @@ var require_deviceTypes = __commonJS({
29
29
  "alarm",
30
30
  "camera",
31
31
  "mediaSource",
32
- "motionSensor"
32
+ "motionSensor",
33
+ "gateway"
33
34
  ];
34
35
  module2.exports = types;
35
36
  }
@@ -179,7 +180,13 @@ var require_device = __commonJS({
179
180
  "lock",
180
181
  "courtesy",
181
182
  "sceneController",
182
- "gateway"
183
+ "gateway",
184
+ "tv",
185
+ "dvr",
186
+ "appleTv",
187
+ "discPlayer",
188
+ "mediaPlayer",
189
+ "uncontrolledDevice"
183
190
  ]
184
191
  },
185
192
  name: {
@@ -7514,7 +7514,13 @@ var require_device = __commonJS({
7514
7514
  "lock",
7515
7515
  "courtesy",
7516
7516
  "sceneController",
7517
- "gateway"
7517
+ "gateway",
7518
+ "tv",
7519
+ "dvr",
7520
+ "appleTv",
7521
+ "discPlayer",
7522
+ "mediaPlayer",
7523
+ "uncontrolledDevice"
7518
7524
  ]
7519
7525
  },
7520
7526
  name: {
@@ -10601,6 +10607,7 @@ var require_room2 = __commonJS({
10601
10607
  "src/Models/room.js"(exports, module) {
10602
10608
  var schemas = require_schema();
10603
10609
  var schema = require_room();
10610
+ var deviceSchema = require_device();
10604
10611
  var Kohost = require_kohost();
10605
10612
  var cloneDeep = require_lodash();
10606
10613
  var Switch = require_switch2();
@@ -10622,21 +10629,18 @@ var require_room2 = __commonJS({
10622
10629
  super(roomData);
10623
10630
  }
10624
10631
  static getDevicePath(type) {
10625
- const validTypes = [
10626
- "dimmer",
10627
- "switch",
10628
- "thermostat",
10629
- "lock",
10630
- "windowCovering",
10631
- "courtesy",
10632
- "camera",
10633
- "mediaSource",
10634
- "motionSensor",
10635
- "alarm"
10636
- ];
10632
+ const validTypes = deviceSchema.definitions.type.enum;
10637
10633
  if (!validTypes.includes(type))
10638
10634
  throw new Error("Invalid device type:" + type);
10639
10635
  switch (type) {
10636
+ case "tv":
10637
+ case "dvr":
10638
+ case "appleTv":
10639
+ case "discPlayer":
10640
+ case "mediaPlayer":
10641
+ case "uncontrolledDevice":
10642
+ case "mediaSource":
10643
+ return "mediaSources";
10640
10644
  case "courtesy":
10641
10645
  return type;
10642
10646
  case "switch":
@@ -13680,19 +13684,7 @@ var require_discoveredDevice = __commonJS({
13680
13684
  type: "string"
13681
13685
  },
13682
13686
  type: {
13683
- type: "string",
13684
- enum: [
13685
- "dimmer",
13686
- "switch",
13687
- "motionSensor",
13688
- "thermostat",
13689
- "lock",
13690
- "camera",
13691
- "courtesy",
13692
- "mediaSource",
13693
- "alarm",
13694
- "windowCovering"
13695
- ]
13687
+ $ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/type"
13696
13688
  },
13697
13689
  driver: {
13698
13690
  type: "string"