@kohost/api-client 3.0.0-beta.30 → 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.
- package/dist/cjs/Models.js +18 -47
- package/dist/cjs/defs.js +2 -1
- package/dist/cjs/utils.js +9 -2
- package/dist/esm/Models.js +18 -47
- package/dist/esm/Models.js.map +2 -2
- package/dist/esm/defs.js +2 -1
- package/dist/esm/defs.js.map +2 -2
- package/dist/esm/utils.js +9 -2
- package/dist/esm/utils.js.map +2 -2
- package/package.json +1 -1
package/dist/cjs/Models.js
CHANGED
|
@@ -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: {
|
|
@@ -2233,24 +2239,6 @@ var require_room = __commonJS({
|
|
|
2233
2239
|
$ref: "https://api.kohost.io/schemas/v3/alarm.json"
|
|
2234
2240
|
}
|
|
2235
2241
|
},
|
|
2236
|
-
media: {
|
|
2237
|
-
type: "object",
|
|
2238
|
-
additionalProperties: false,
|
|
2239
|
-
default: {
|
|
2240
|
-
volume: 0,
|
|
2241
|
-
currentSource: null
|
|
2242
|
-
},
|
|
2243
|
-
properties: {
|
|
2244
|
-
volume: {
|
|
2245
|
-
type: "number",
|
|
2246
|
-
minimum: 0,
|
|
2247
|
-
maximum: 100
|
|
2248
|
-
},
|
|
2249
|
-
currentSource: {
|
|
2250
|
-
type: ["string", "null"]
|
|
2251
|
-
}
|
|
2252
|
-
}
|
|
2253
|
-
},
|
|
2254
2242
|
scenes: {
|
|
2255
2243
|
type: "array",
|
|
2256
2244
|
default: [],
|
|
@@ -2439,6 +2427,7 @@ var require_room2 = __commonJS({
|
|
|
2439
2427
|
"src/Models/room.js"(exports2, module2) {
|
|
2440
2428
|
var schemas = require_schema();
|
|
2441
2429
|
var schema = require_room();
|
|
2430
|
+
var deviceSchema = require_device();
|
|
2442
2431
|
var Kohost = require_kohost();
|
|
2443
2432
|
var cloneDeep = require("lodash.clonedeep");
|
|
2444
2433
|
var Switch2 = require_switch2();
|
|
@@ -2460,21 +2449,18 @@ var require_room2 = __commonJS({
|
|
|
2460
2449
|
super(roomData);
|
|
2461
2450
|
}
|
|
2462
2451
|
static getDevicePath(type) {
|
|
2463
|
-
const validTypes =
|
|
2464
|
-
"dimmer",
|
|
2465
|
-
"switch",
|
|
2466
|
-
"thermostat",
|
|
2467
|
-
"lock",
|
|
2468
|
-
"windowCovering",
|
|
2469
|
-
"courtesy",
|
|
2470
|
-
"camera",
|
|
2471
|
-
"mediaSource",
|
|
2472
|
-
"motionSensor",
|
|
2473
|
-
"alarm"
|
|
2474
|
-
];
|
|
2452
|
+
const validTypes = deviceSchema.definitions.type.enum;
|
|
2475
2453
|
if (!validTypes.includes(type))
|
|
2476
2454
|
throw new Error("Invalid device type:" + type);
|
|
2477
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";
|
|
2478
2464
|
case "courtesy":
|
|
2479
2465
|
return type;
|
|
2480
2466
|
case "switch":
|
|
@@ -3454,19 +3440,7 @@ var require_discoveredDevice = __commonJS({
|
|
|
3454
3440
|
type: "string"
|
|
3455
3441
|
},
|
|
3456
3442
|
type: {
|
|
3457
|
-
|
|
3458
|
-
enum: [
|
|
3459
|
-
"dimmer",
|
|
3460
|
-
"switch",
|
|
3461
|
-
"motionSensor",
|
|
3462
|
-
"thermostat",
|
|
3463
|
-
"lock",
|
|
3464
|
-
"camera",
|
|
3465
|
-
"courtesy",
|
|
3466
|
-
"mediaSource",
|
|
3467
|
-
"alarm",
|
|
3468
|
-
"windowCovering"
|
|
3469
|
-
]
|
|
3443
|
+
$ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/type"
|
|
3470
3444
|
},
|
|
3471
3445
|
driver: {
|
|
3472
3446
|
type: "string"
|
|
@@ -3745,9 +3719,6 @@ var require_energyReportShard2 = __commonJS({
|
|
|
3745
3719
|
Object.defineProperty(EnergyReportShard2, "validProperties", {
|
|
3746
3720
|
value: Object.keys(schema.properties)
|
|
3747
3721
|
});
|
|
3748
|
-
Object.defineProperty(EnergyReportShard2, "actionProperties", {
|
|
3749
|
-
value: ["state"]
|
|
3750
|
-
});
|
|
3751
3722
|
module2.exports = EnergyReportShard2;
|
|
3752
3723
|
}
|
|
3753
3724
|
});
|
package/dist/cjs/defs.js
CHANGED
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: {
|
package/dist/esm/Models.js
CHANGED
|
@@ -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: {
|
|
@@ -9712,24 +9718,6 @@ var require_room = __commonJS({
|
|
|
9712
9718
|
$ref: "https://api.kohost.io/schemas/v3/alarm.json"
|
|
9713
9719
|
}
|
|
9714
9720
|
},
|
|
9715
|
-
media: {
|
|
9716
|
-
type: "object",
|
|
9717
|
-
additionalProperties: false,
|
|
9718
|
-
default: {
|
|
9719
|
-
volume: 0,
|
|
9720
|
-
currentSource: null
|
|
9721
|
-
},
|
|
9722
|
-
properties: {
|
|
9723
|
-
volume: {
|
|
9724
|
-
type: "number",
|
|
9725
|
-
minimum: 0,
|
|
9726
|
-
maximum: 100
|
|
9727
|
-
},
|
|
9728
|
-
currentSource: {
|
|
9729
|
-
type: ["string", "null"]
|
|
9730
|
-
}
|
|
9731
|
-
}
|
|
9732
|
-
},
|
|
9733
9721
|
scenes: {
|
|
9734
9722
|
type: "array",
|
|
9735
9723
|
default: [],
|
|
@@ -10619,6 +10607,7 @@ var require_room2 = __commonJS({
|
|
|
10619
10607
|
"src/Models/room.js"(exports, module) {
|
|
10620
10608
|
var schemas = require_schema();
|
|
10621
10609
|
var schema = require_room();
|
|
10610
|
+
var deviceSchema = require_device();
|
|
10622
10611
|
var Kohost = require_kohost();
|
|
10623
10612
|
var cloneDeep = require_lodash();
|
|
10624
10613
|
var Switch = require_switch2();
|
|
@@ -10640,21 +10629,18 @@ var require_room2 = __commonJS({
|
|
|
10640
10629
|
super(roomData);
|
|
10641
10630
|
}
|
|
10642
10631
|
static getDevicePath(type) {
|
|
10643
|
-
const validTypes =
|
|
10644
|
-
"dimmer",
|
|
10645
|
-
"switch",
|
|
10646
|
-
"thermostat",
|
|
10647
|
-
"lock",
|
|
10648
|
-
"windowCovering",
|
|
10649
|
-
"courtesy",
|
|
10650
|
-
"camera",
|
|
10651
|
-
"mediaSource",
|
|
10652
|
-
"motionSensor",
|
|
10653
|
-
"alarm"
|
|
10654
|
-
];
|
|
10632
|
+
const validTypes = deviceSchema.definitions.type.enum;
|
|
10655
10633
|
if (!validTypes.includes(type))
|
|
10656
10634
|
throw new Error("Invalid device type:" + type);
|
|
10657
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";
|
|
10658
10644
|
case "courtesy":
|
|
10659
10645
|
return type;
|
|
10660
10646
|
case "switch":
|
|
@@ -13698,19 +13684,7 @@ var require_discoveredDevice = __commonJS({
|
|
|
13698
13684
|
type: "string"
|
|
13699
13685
|
},
|
|
13700
13686
|
type: {
|
|
13701
|
-
|
|
13702
|
-
enum: [
|
|
13703
|
-
"dimmer",
|
|
13704
|
-
"switch",
|
|
13705
|
-
"motionSensor",
|
|
13706
|
-
"thermostat",
|
|
13707
|
-
"lock",
|
|
13708
|
-
"camera",
|
|
13709
|
-
"courtesy",
|
|
13710
|
-
"mediaSource",
|
|
13711
|
-
"alarm",
|
|
13712
|
-
"windowCovering"
|
|
13713
|
-
]
|
|
13687
|
+
$ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/type"
|
|
13714
13688
|
},
|
|
13715
13689
|
driver: {
|
|
13716
13690
|
type: "string"
|
|
@@ -13989,9 +13963,6 @@ var require_energyReportShard2 = __commonJS({
|
|
|
13989
13963
|
Object.defineProperty(EnergyReportShard, "validProperties", {
|
|
13990
13964
|
value: Object.keys(schema.properties)
|
|
13991
13965
|
});
|
|
13992
|
-
Object.defineProperty(EnergyReportShard, "actionProperties", {
|
|
13993
|
-
value: ["state"]
|
|
13994
|
-
});
|
|
13995
13966
|
module.exports = EnergyReportShard;
|
|
13996
13967
|
}
|
|
13997
13968
|
});
|