@kohost/api-client 3.0.0-beta.29 → 3.0.0-beta.31
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 +42 -218
- package/dist/esm/Models.js +42 -218
- package/dist/esm/Models.js.map +4 -4
- package/package.json +1 -1
package/dist/cjs/Models.js
CHANGED
|
@@ -2233,24 +2233,6 @@ var require_room = __commonJS({
|
|
|
2233
2233
|
$ref: "https://api.kohost.io/schemas/v3/alarm.json"
|
|
2234
2234
|
}
|
|
2235
2235
|
},
|
|
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
2236
|
scenes: {
|
|
2255
2237
|
type: "array",
|
|
2256
2238
|
default: [],
|
|
@@ -3648,16 +3630,23 @@ var require_energyReportShard = __commonJS({
|
|
|
3648
3630
|
title: "Energy Report Shard",
|
|
3649
3631
|
description: "Shard used for Energy Reports",
|
|
3650
3632
|
type: "object",
|
|
3651
|
-
required: [
|
|
3633
|
+
required: [
|
|
3634
|
+
"id",
|
|
3635
|
+
"type",
|
|
3636
|
+
"roomId",
|
|
3637
|
+
"first",
|
|
3638
|
+
"last",
|
|
3639
|
+
"data",
|
|
3640
|
+
"ndata",
|
|
3641
|
+
"expires"
|
|
3642
|
+
],
|
|
3652
3643
|
properties: {
|
|
3653
3644
|
id: {
|
|
3654
3645
|
$ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
|
|
3655
3646
|
},
|
|
3656
3647
|
type: {
|
|
3657
3648
|
type: "string",
|
|
3658
|
-
enum: [
|
|
3659
|
-
"energyReportShard"
|
|
3660
|
-
],
|
|
3649
|
+
enum: ["energyReportShard"],
|
|
3661
3650
|
default: "energyReportShard"
|
|
3662
3651
|
},
|
|
3663
3652
|
roomId: {
|
|
@@ -3738,182 +3727,41 @@ var require_energyReportShard2 = __commonJS({
|
|
|
3738
3727
|
Object.defineProperty(EnergyReportShard2, "validProperties", {
|
|
3739
3728
|
value: Object.keys(schema.properties)
|
|
3740
3729
|
});
|
|
3741
|
-
Object.defineProperty(EnergyReportShard2, "actionProperties", {
|
|
3742
|
-
value: ["state"]
|
|
3743
|
-
});
|
|
3744
3730
|
module2.exports = EnergyReportShard2;
|
|
3745
|
-
var shard = new EnergyReportShard2({
|
|
3746
|
-
"id": "ShardId1",
|
|
3747
|
-
"type": "energyReportShard",
|
|
3748
|
-
"roomId": "TestRoom",
|
|
3749
|
-
"first": /* @__PURE__ */ new Date(),
|
|
3750
|
-
"last": /* @__PURE__ */ new Date(),
|
|
3751
|
-
"data": [{
|
|
3752
|
-
"time": /* @__PURE__ */ new Date(),
|
|
3753
|
-
"watts": 100,
|
|
3754
|
-
"id": "1",
|
|
3755
|
-
"type": "dimmer",
|
|
3756
|
-
"value": 0.121315
|
|
3757
|
-
}],
|
|
3758
|
-
"ndata": 1,
|
|
3759
|
-
"expires": /* @__PURE__ */ new Date()
|
|
3760
|
-
});
|
|
3761
|
-
console.log(shard);
|
|
3762
3731
|
}
|
|
3763
3732
|
});
|
|
3764
3733
|
|
|
3765
|
-
// src/schemas/
|
|
3766
|
-
var
|
|
3767
|
-
"src/schemas/
|
|
3734
|
+
// src/schemas/energyReport.json
|
|
3735
|
+
var require_energyReport = __commonJS({
|
|
3736
|
+
"src/schemas/energyReport.json"(exports2, module2) {
|
|
3768
3737
|
module2.exports = {
|
|
3769
3738
|
$schema: "http://json-schema.org/draft-07/schema",
|
|
3770
|
-
$id: "https://api.kohost.io/schemas/v3/
|
|
3739
|
+
$id: "https://api.kohost.io/schemas/v3/energyReport.json",
|
|
3771
3740
|
title: "Energy Report Hourly",
|
|
3772
3741
|
description: "Hourly Report for Energy based on energy report shards",
|
|
3773
3742
|
type: "object",
|
|
3774
|
-
required: [
|
|
3743
|
+
required: [
|
|
3744
|
+
"id",
|
|
3745
|
+
"type",
|
|
3746
|
+
"roomId",
|
|
3747
|
+
"first",
|
|
3748
|
+
"last",
|
|
3749
|
+
"consumption",
|
|
3750
|
+
"totals",
|
|
3751
|
+
"costPerKw"
|
|
3752
|
+
],
|
|
3775
3753
|
properties: {
|
|
3776
3754
|
id: {
|
|
3777
3755
|
$ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
|
|
3778
3756
|
},
|
|
3779
3757
|
type: {
|
|
3780
3758
|
type: "string",
|
|
3781
|
-
enum: [
|
|
3782
|
-
|
|
3783
|
-
],
|
|
3784
|
-
default: "energyReportHourly"
|
|
3785
|
-
},
|
|
3786
|
-
roomId: {
|
|
3787
|
-
$ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
|
|
3788
|
-
},
|
|
3789
|
-
first: {
|
|
3790
|
-
type: ["string", "object"],
|
|
3791
|
-
format: "date-time"
|
|
3792
|
-
},
|
|
3793
|
-
last: {
|
|
3794
|
-
type: ["string", "object"],
|
|
3795
|
-
format: "date-time"
|
|
3796
|
-
},
|
|
3797
|
-
consumption: {
|
|
3798
|
-
type: "array",
|
|
3799
|
-
items: {
|
|
3800
|
-
type: "object",
|
|
3801
|
-
required: ["id", "type", "kwh"],
|
|
3802
|
-
properties: {
|
|
3803
|
-
id: {
|
|
3804
|
-
$ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
|
|
3805
|
-
},
|
|
3806
|
-
type: {
|
|
3807
|
-
$ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/type"
|
|
3808
|
-
},
|
|
3809
|
-
kwh: {
|
|
3810
|
-
type: "number",
|
|
3811
|
-
minimum: 0
|
|
3812
|
-
}
|
|
3813
|
-
}
|
|
3814
|
-
}
|
|
3815
|
-
},
|
|
3816
|
-
totals: {
|
|
3817
|
-
type: "array",
|
|
3818
|
-
items: {
|
|
3819
|
-
type: "object",
|
|
3820
|
-
required: ["lights", "climate", "media"],
|
|
3821
|
-
properties: {
|
|
3822
|
-
lights: {
|
|
3823
|
-
type: "number",
|
|
3824
|
-
minimum: 0
|
|
3825
|
-
},
|
|
3826
|
-
climate: {
|
|
3827
|
-
type: "number",
|
|
3828
|
-
minimum: 0
|
|
3829
|
-
},
|
|
3830
|
-
media: {
|
|
3831
|
-
type: "number",
|
|
3832
|
-
minimum: 0
|
|
3833
|
-
}
|
|
3834
|
-
}
|
|
3835
|
-
}
|
|
3759
|
+
enum: ["energyReport"],
|
|
3760
|
+
default: "energyReport"
|
|
3836
3761
|
},
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
}
|
|
3841
|
-
}
|
|
3842
|
-
};
|
|
3843
|
-
}
|
|
3844
|
-
});
|
|
3845
|
-
|
|
3846
|
-
// src/Models/energyReportHourly.js
|
|
3847
|
-
var require_energyReportHourly2 = __commonJS({
|
|
3848
|
-
"src/Models/energyReportHourly.js"(exports2, module2) {
|
|
3849
|
-
var schemas = require_schema();
|
|
3850
|
-
var schema = require_energyReportHourly();
|
|
3851
|
-
var Kohost = require_kohost();
|
|
3852
|
-
schemas.add(schema);
|
|
3853
|
-
var validator = schemas.compile(schema);
|
|
3854
|
-
var EnergyReportHourly2 = class extends Kohost {
|
|
3855
|
-
constructor(data) {
|
|
3856
|
-
super(data);
|
|
3857
|
-
}
|
|
3858
|
-
};
|
|
3859
|
-
__name(EnergyReportHourly2, "EnergyReportHourly");
|
|
3860
|
-
Object.defineProperty(EnergyReportHourly2.prototype, "schema", {
|
|
3861
|
-
value: schema
|
|
3862
|
-
});
|
|
3863
|
-
Object.defineProperty(EnergyReportHourly2.prototype, "validator", {
|
|
3864
|
-
get: function() {
|
|
3865
|
-
return validator;
|
|
3866
|
-
}
|
|
3867
|
-
});
|
|
3868
|
-
Object.defineProperty(EnergyReportHourly2, "validProperties", {
|
|
3869
|
-
value: Object.keys(schema.properties)
|
|
3870
|
-
});
|
|
3871
|
-
Object.defineProperty(EnergyReportHourly2, "actionProperties", {
|
|
3872
|
-
value: ["state"]
|
|
3873
|
-
});
|
|
3874
|
-
module2.exports = EnergyReportHourly2;
|
|
3875
|
-
var hourlyShardReport = new EnergyReportHourly2({
|
|
3876
|
-
"id": "RepIdHr1",
|
|
3877
|
-
"type": "energyReportHourly",
|
|
3878
|
-
"roomId": "TestRoom",
|
|
3879
|
-
"first": /* @__PURE__ */ new Date(),
|
|
3880
|
-
"last": /* @__PURE__ */ new Date(),
|
|
3881
|
-
"consumption": [{
|
|
3882
|
-
"id": "1",
|
|
3883
|
-
"type": "dimmer",
|
|
3884
|
-
"kwh": 0.121315
|
|
3885
|
-
}],
|
|
3886
|
-
"totals": [{
|
|
3887
|
-
"lights": 10,
|
|
3888
|
-
"climate": 10,
|
|
3889
|
-
"media": 10
|
|
3890
|
-
}],
|
|
3891
|
-
"costPerKw": 0.14
|
|
3892
|
-
});
|
|
3893
|
-
console.log(hourlyShardReport);
|
|
3894
|
-
}
|
|
3895
|
-
});
|
|
3896
|
-
|
|
3897
|
-
// src/schemas/energyReportDaily.json
|
|
3898
|
-
var require_energyReportDaily = __commonJS({
|
|
3899
|
-
"src/schemas/energyReportDaily.json"(exports2, module2) {
|
|
3900
|
-
module2.exports = {
|
|
3901
|
-
$schema: "http://json-schema.org/draft-07/schema",
|
|
3902
|
-
$id: "https://api.kohost.io/schemas/v3/energyReportDaily.json",
|
|
3903
|
-
title: "Energy Report Daily",
|
|
3904
|
-
description: "Daily Report for Energy based on energy report shards",
|
|
3905
|
-
type: "object",
|
|
3906
|
-
required: ["id", "type", "roomId", "first", "last", "consumption", "totals", "costPerKw"],
|
|
3907
|
-
properties: {
|
|
3908
|
-
id: {
|
|
3909
|
-
$ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/id"
|
|
3910
|
-
},
|
|
3911
|
-
type: {
|
|
3912
|
-
type: "string",
|
|
3913
|
-
enum: [
|
|
3914
|
-
"energyReportDaily"
|
|
3915
|
-
],
|
|
3916
|
-
default: "energyReportDaily"
|
|
3762
|
+
reportTime: {
|
|
3763
|
+
time: "string",
|
|
3764
|
+
enum: ["hourly", "daily", "monthly"]
|
|
3917
3765
|
},
|
|
3918
3766
|
roomId: {
|
|
3919
3767
|
$ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
|
|
@@ -3975,54 +3823,32 @@ var require_energyReportDaily = __commonJS({
|
|
|
3975
3823
|
}
|
|
3976
3824
|
});
|
|
3977
3825
|
|
|
3978
|
-
// src/Models/
|
|
3979
|
-
var
|
|
3980
|
-
"src/Models/
|
|
3826
|
+
// src/Models/energyReport.js
|
|
3827
|
+
var require_energyReport2 = __commonJS({
|
|
3828
|
+
"src/Models/energyReport.js"(exports2, module2) {
|
|
3981
3829
|
var schemas = require_schema();
|
|
3982
|
-
var schema =
|
|
3830
|
+
var schema = require_energyReport();
|
|
3983
3831
|
var Kohost = require_kohost();
|
|
3984
3832
|
schemas.add(schema);
|
|
3985
3833
|
var validator = schemas.compile(schema);
|
|
3986
|
-
var
|
|
3834
|
+
var EnergyReport2 = class extends Kohost {
|
|
3987
3835
|
constructor(data) {
|
|
3988
3836
|
super(data);
|
|
3989
3837
|
}
|
|
3990
3838
|
};
|
|
3991
|
-
__name(
|
|
3992
|
-
Object.defineProperty(
|
|
3839
|
+
__name(EnergyReport2, "EnergyReport");
|
|
3840
|
+
Object.defineProperty(EnergyReport2.prototype, "schema", {
|
|
3993
3841
|
value: schema
|
|
3994
3842
|
});
|
|
3995
|
-
Object.defineProperty(
|
|
3843
|
+
Object.defineProperty(EnergyReport2.prototype, "validator", {
|
|
3996
3844
|
get: function() {
|
|
3997
3845
|
return validator;
|
|
3998
3846
|
}
|
|
3999
3847
|
});
|
|
4000
|
-
Object.defineProperty(
|
|
3848
|
+
Object.defineProperty(EnergyReport2, "validProperties", {
|
|
4001
3849
|
value: Object.keys(schema.properties)
|
|
4002
3850
|
});
|
|
4003
|
-
|
|
4004
|
-
value: ["state"]
|
|
4005
|
-
});
|
|
4006
|
-
module2.exports = energyReportDaily;
|
|
4007
|
-
var dailyShardReport = new energyReportDaily({
|
|
4008
|
-
"id": "RepIdHr1",
|
|
4009
|
-
"type": "energyReportDaily",
|
|
4010
|
-
"roomId": "TestRoom",
|
|
4011
|
-
"first": /* @__PURE__ */ new Date(),
|
|
4012
|
-
"last": /* @__PURE__ */ new Date(),
|
|
4013
|
-
"consumption": [{
|
|
4014
|
-
"id": "1",
|
|
4015
|
-
"type": "dimmer",
|
|
4016
|
-
"kwh": 0.121315
|
|
4017
|
-
}],
|
|
4018
|
-
"totals": [{
|
|
4019
|
-
"lights": 10,
|
|
4020
|
-
"climate": 10,
|
|
4021
|
-
"media": 10
|
|
4022
|
-
}],
|
|
4023
|
-
"costPerKw": 0.14
|
|
4024
|
-
});
|
|
4025
|
-
console.log(dailyShardReport);
|
|
3851
|
+
module2.exports = EnergyReport2;
|
|
4026
3852
|
}
|
|
4027
3853
|
});
|
|
4028
3854
|
|
|
@@ -4377,8 +4203,7 @@ var DiscoveredDevice = require_discoveredDevice2();
|
|
|
4377
4203
|
var Credential = require_credential2();
|
|
4378
4204
|
var ShortLink = require_shortLink2();
|
|
4379
4205
|
var EnergyReportShard = require_energyReportShard2();
|
|
4380
|
-
var
|
|
4381
|
-
var EnergyReportDaily = require_energyReportDaily2();
|
|
4206
|
+
var EnergyReport = require_energyReport2();
|
|
4382
4207
|
var Property = require_property2();
|
|
4383
4208
|
var Organization = require_organization2();
|
|
4384
4209
|
module.exports = {
|
|
@@ -4409,6 +4234,5 @@ module.exports = {
|
|
|
4409
4234
|
Credential,
|
|
4410
4235
|
ShortLink,
|
|
4411
4236
|
EnergyReportShard,
|
|
4412
|
-
|
|
4413
|
-
EnergyReportDaily
|
|
4237
|
+
EnergyReport
|
|
4414
4238
|
};
|
package/dist/esm/Models.js
CHANGED
|
@@ -9712,24 +9712,6 @@ var require_room = __commonJS({
|
|
|
9712
9712
|
$ref: "https://api.kohost.io/schemas/v3/alarm.json"
|
|
9713
9713
|
}
|
|
9714
9714
|
},
|
|
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
9715
|
scenes: {
|
|
9734
9716
|
type: "array",
|
|
9735
9717
|
default: [],
|
|
@@ -13892,16 +13874,23 @@ var require_energyReportShard = __commonJS({
|
|
|
13892
13874
|
title: "Energy Report Shard",
|
|
13893
13875
|
description: "Shard used for Energy Reports",
|
|
13894
13876
|
type: "object",
|
|
13895
|
-
required: [
|
|
13877
|
+
required: [
|
|
13878
|
+
"id",
|
|
13879
|
+
"type",
|
|
13880
|
+
"roomId",
|
|
13881
|
+
"first",
|
|
13882
|
+
"last",
|
|
13883
|
+
"data",
|
|
13884
|
+
"ndata",
|
|
13885
|
+
"expires"
|
|
13886
|
+
],
|
|
13896
13887
|
properties: {
|
|
13897
13888
|
id: {
|
|
13898
13889
|
$ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
|
|
13899
13890
|
},
|
|
13900
13891
|
type: {
|
|
13901
13892
|
type: "string",
|
|
13902
|
-
enum: [
|
|
13903
|
-
"energyReportShard"
|
|
13904
|
-
],
|
|
13893
|
+
enum: ["energyReportShard"],
|
|
13905
13894
|
default: "energyReportShard"
|
|
13906
13895
|
},
|
|
13907
13896
|
roomId: {
|
|
@@ -13982,182 +13971,41 @@ var require_energyReportShard2 = __commonJS({
|
|
|
13982
13971
|
Object.defineProperty(EnergyReportShard, "validProperties", {
|
|
13983
13972
|
value: Object.keys(schema.properties)
|
|
13984
13973
|
});
|
|
13985
|
-
Object.defineProperty(EnergyReportShard, "actionProperties", {
|
|
13986
|
-
value: ["state"]
|
|
13987
|
-
});
|
|
13988
13974
|
module.exports = EnergyReportShard;
|
|
13989
|
-
var shard = new EnergyReportShard({
|
|
13990
|
-
"id": "ShardId1",
|
|
13991
|
-
"type": "energyReportShard",
|
|
13992
|
-
"roomId": "TestRoom",
|
|
13993
|
-
"first": /* @__PURE__ */ new Date(),
|
|
13994
|
-
"last": /* @__PURE__ */ new Date(),
|
|
13995
|
-
"data": [{
|
|
13996
|
-
"time": /* @__PURE__ */ new Date(),
|
|
13997
|
-
"watts": 100,
|
|
13998
|
-
"id": "1",
|
|
13999
|
-
"type": "dimmer",
|
|
14000
|
-
"value": 0.121315
|
|
14001
|
-
}],
|
|
14002
|
-
"ndata": 1,
|
|
14003
|
-
"expires": /* @__PURE__ */ new Date()
|
|
14004
|
-
});
|
|
14005
|
-
console.log(shard);
|
|
14006
13975
|
}
|
|
14007
13976
|
});
|
|
14008
13977
|
|
|
14009
|
-
// src/schemas/
|
|
14010
|
-
var
|
|
14011
|
-
"src/schemas/
|
|
13978
|
+
// src/schemas/energyReport.json
|
|
13979
|
+
var require_energyReport = __commonJS({
|
|
13980
|
+
"src/schemas/energyReport.json"(exports, module) {
|
|
14012
13981
|
module.exports = {
|
|
14013
13982
|
$schema: "http://json-schema.org/draft-07/schema",
|
|
14014
|
-
$id: "https://api.kohost.io/schemas/v3/
|
|
13983
|
+
$id: "https://api.kohost.io/schemas/v3/energyReport.json",
|
|
14015
13984
|
title: "Energy Report Hourly",
|
|
14016
13985
|
description: "Hourly Report for Energy based on energy report shards",
|
|
14017
13986
|
type: "object",
|
|
14018
|
-
required: [
|
|
13987
|
+
required: [
|
|
13988
|
+
"id",
|
|
13989
|
+
"type",
|
|
13990
|
+
"roomId",
|
|
13991
|
+
"first",
|
|
13992
|
+
"last",
|
|
13993
|
+
"consumption",
|
|
13994
|
+
"totals",
|
|
13995
|
+
"costPerKw"
|
|
13996
|
+
],
|
|
14019
13997
|
properties: {
|
|
14020
13998
|
id: {
|
|
14021
13999
|
$ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
|
|
14022
14000
|
},
|
|
14023
14001
|
type: {
|
|
14024
14002
|
type: "string",
|
|
14025
|
-
enum: [
|
|
14026
|
-
|
|
14027
|
-
],
|
|
14028
|
-
default: "energyReportHourly"
|
|
14029
|
-
},
|
|
14030
|
-
roomId: {
|
|
14031
|
-
$ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
|
|
14032
|
-
},
|
|
14033
|
-
first: {
|
|
14034
|
-
type: ["string", "object"],
|
|
14035
|
-
format: "date-time"
|
|
14036
|
-
},
|
|
14037
|
-
last: {
|
|
14038
|
-
type: ["string", "object"],
|
|
14039
|
-
format: "date-time"
|
|
14040
|
-
},
|
|
14041
|
-
consumption: {
|
|
14042
|
-
type: "array",
|
|
14043
|
-
items: {
|
|
14044
|
-
type: "object",
|
|
14045
|
-
required: ["id", "type", "kwh"],
|
|
14046
|
-
properties: {
|
|
14047
|
-
id: {
|
|
14048
|
-
$ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
|
|
14049
|
-
},
|
|
14050
|
-
type: {
|
|
14051
|
-
$ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/type"
|
|
14052
|
-
},
|
|
14053
|
-
kwh: {
|
|
14054
|
-
type: "number",
|
|
14055
|
-
minimum: 0
|
|
14056
|
-
}
|
|
14057
|
-
}
|
|
14058
|
-
}
|
|
14059
|
-
},
|
|
14060
|
-
totals: {
|
|
14061
|
-
type: "array",
|
|
14062
|
-
items: {
|
|
14063
|
-
type: "object",
|
|
14064
|
-
required: ["lights", "climate", "media"],
|
|
14065
|
-
properties: {
|
|
14066
|
-
lights: {
|
|
14067
|
-
type: "number",
|
|
14068
|
-
minimum: 0
|
|
14069
|
-
},
|
|
14070
|
-
climate: {
|
|
14071
|
-
type: "number",
|
|
14072
|
-
minimum: 0
|
|
14073
|
-
},
|
|
14074
|
-
media: {
|
|
14075
|
-
type: "number",
|
|
14076
|
-
minimum: 0
|
|
14077
|
-
}
|
|
14078
|
-
}
|
|
14079
|
-
}
|
|
14003
|
+
enum: ["energyReport"],
|
|
14004
|
+
default: "energyReport"
|
|
14080
14005
|
},
|
|
14081
|
-
|
|
14082
|
-
|
|
14083
|
-
|
|
14084
|
-
}
|
|
14085
|
-
}
|
|
14086
|
-
};
|
|
14087
|
-
}
|
|
14088
|
-
});
|
|
14089
|
-
|
|
14090
|
-
// src/Models/energyReportHourly.js
|
|
14091
|
-
var require_energyReportHourly2 = __commonJS({
|
|
14092
|
-
"src/Models/energyReportHourly.js"(exports, module) {
|
|
14093
|
-
var schemas = require_schema();
|
|
14094
|
-
var schema = require_energyReportHourly();
|
|
14095
|
-
var Kohost = require_kohost();
|
|
14096
|
-
schemas.add(schema);
|
|
14097
|
-
var validator = schemas.compile(schema);
|
|
14098
|
-
var EnergyReportHourly = class extends Kohost {
|
|
14099
|
-
constructor(data) {
|
|
14100
|
-
super(data);
|
|
14101
|
-
}
|
|
14102
|
-
};
|
|
14103
|
-
__name(EnergyReportHourly, "EnergyReportHourly");
|
|
14104
|
-
Object.defineProperty(EnergyReportHourly.prototype, "schema", {
|
|
14105
|
-
value: schema
|
|
14106
|
-
});
|
|
14107
|
-
Object.defineProperty(EnergyReportHourly.prototype, "validator", {
|
|
14108
|
-
get: function() {
|
|
14109
|
-
return validator;
|
|
14110
|
-
}
|
|
14111
|
-
});
|
|
14112
|
-
Object.defineProperty(EnergyReportHourly, "validProperties", {
|
|
14113
|
-
value: Object.keys(schema.properties)
|
|
14114
|
-
});
|
|
14115
|
-
Object.defineProperty(EnergyReportHourly, "actionProperties", {
|
|
14116
|
-
value: ["state"]
|
|
14117
|
-
});
|
|
14118
|
-
module.exports = EnergyReportHourly;
|
|
14119
|
-
var hourlyShardReport = new EnergyReportHourly({
|
|
14120
|
-
"id": "RepIdHr1",
|
|
14121
|
-
"type": "energyReportHourly",
|
|
14122
|
-
"roomId": "TestRoom",
|
|
14123
|
-
"first": /* @__PURE__ */ new Date(),
|
|
14124
|
-
"last": /* @__PURE__ */ new Date(),
|
|
14125
|
-
"consumption": [{
|
|
14126
|
-
"id": "1",
|
|
14127
|
-
"type": "dimmer",
|
|
14128
|
-
"kwh": 0.121315
|
|
14129
|
-
}],
|
|
14130
|
-
"totals": [{
|
|
14131
|
-
"lights": 10,
|
|
14132
|
-
"climate": 10,
|
|
14133
|
-
"media": 10
|
|
14134
|
-
}],
|
|
14135
|
-
"costPerKw": 0.14
|
|
14136
|
-
});
|
|
14137
|
-
console.log(hourlyShardReport);
|
|
14138
|
-
}
|
|
14139
|
-
});
|
|
14140
|
-
|
|
14141
|
-
// src/schemas/energyReportDaily.json
|
|
14142
|
-
var require_energyReportDaily = __commonJS({
|
|
14143
|
-
"src/schemas/energyReportDaily.json"(exports, module) {
|
|
14144
|
-
module.exports = {
|
|
14145
|
-
$schema: "http://json-schema.org/draft-07/schema",
|
|
14146
|
-
$id: "https://api.kohost.io/schemas/v3/energyReportDaily.json",
|
|
14147
|
-
title: "Energy Report Daily",
|
|
14148
|
-
description: "Daily Report for Energy based on energy report shards",
|
|
14149
|
-
type: "object",
|
|
14150
|
-
required: ["id", "type", "roomId", "first", "last", "consumption", "totals", "costPerKw"],
|
|
14151
|
-
properties: {
|
|
14152
|
-
id: {
|
|
14153
|
-
$ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/id"
|
|
14154
|
-
},
|
|
14155
|
-
type: {
|
|
14156
|
-
type: "string",
|
|
14157
|
-
enum: [
|
|
14158
|
-
"energyReportDaily"
|
|
14159
|
-
],
|
|
14160
|
-
default: "energyReportDaily"
|
|
14006
|
+
reportTime: {
|
|
14007
|
+
time: "string",
|
|
14008
|
+
enum: ["hourly", "daily", "monthly"]
|
|
14161
14009
|
},
|
|
14162
14010
|
roomId: {
|
|
14163
14011
|
$ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
|
|
@@ -14219,54 +14067,32 @@ var require_energyReportDaily = __commonJS({
|
|
|
14219
14067
|
}
|
|
14220
14068
|
});
|
|
14221
14069
|
|
|
14222
|
-
// src/Models/
|
|
14223
|
-
var
|
|
14224
|
-
"src/Models/
|
|
14070
|
+
// src/Models/energyReport.js
|
|
14071
|
+
var require_energyReport2 = __commonJS({
|
|
14072
|
+
"src/Models/energyReport.js"(exports, module) {
|
|
14225
14073
|
var schemas = require_schema();
|
|
14226
|
-
var schema =
|
|
14074
|
+
var schema = require_energyReport();
|
|
14227
14075
|
var Kohost = require_kohost();
|
|
14228
14076
|
schemas.add(schema);
|
|
14229
14077
|
var validator = schemas.compile(schema);
|
|
14230
|
-
var
|
|
14078
|
+
var EnergyReport = class extends Kohost {
|
|
14231
14079
|
constructor(data) {
|
|
14232
14080
|
super(data);
|
|
14233
14081
|
}
|
|
14234
14082
|
};
|
|
14235
|
-
__name(
|
|
14236
|
-
Object.defineProperty(
|
|
14083
|
+
__name(EnergyReport, "EnergyReport");
|
|
14084
|
+
Object.defineProperty(EnergyReport.prototype, "schema", {
|
|
14237
14085
|
value: schema
|
|
14238
14086
|
});
|
|
14239
|
-
Object.defineProperty(
|
|
14087
|
+
Object.defineProperty(EnergyReport.prototype, "validator", {
|
|
14240
14088
|
get: function() {
|
|
14241
14089
|
return validator;
|
|
14242
14090
|
}
|
|
14243
14091
|
});
|
|
14244
|
-
Object.defineProperty(
|
|
14092
|
+
Object.defineProperty(EnergyReport, "validProperties", {
|
|
14245
14093
|
value: Object.keys(schema.properties)
|
|
14246
14094
|
});
|
|
14247
|
-
|
|
14248
|
-
value: ["state"]
|
|
14249
|
-
});
|
|
14250
|
-
module.exports = energyReportDaily;
|
|
14251
|
-
var dailyShardReport = new energyReportDaily({
|
|
14252
|
-
"id": "RepIdHr1",
|
|
14253
|
-
"type": "energyReportDaily",
|
|
14254
|
-
"roomId": "TestRoom",
|
|
14255
|
-
"first": /* @__PURE__ */ new Date(),
|
|
14256
|
-
"last": /* @__PURE__ */ new Date(),
|
|
14257
|
-
"consumption": [{
|
|
14258
|
-
"id": "1",
|
|
14259
|
-
"type": "dimmer",
|
|
14260
|
-
"kwh": 0.121315
|
|
14261
|
-
}],
|
|
14262
|
-
"totals": [{
|
|
14263
|
-
"lights": 10,
|
|
14264
|
-
"climate": 10,
|
|
14265
|
-
"media": 10
|
|
14266
|
-
}],
|
|
14267
|
-
"costPerKw": 0.14
|
|
14268
|
-
});
|
|
14269
|
-
console.log(dailyShardReport);
|
|
14095
|
+
module.exports = EnergyReport;
|
|
14270
14096
|
}
|
|
14271
14097
|
});
|
|
14272
14098
|
|
|
@@ -14623,8 +14449,7 @@ var require_Models = __commonJS({
|
|
|
14623
14449
|
var Credential = require_credential2();
|
|
14624
14450
|
var ShortLink = require_shortLink2();
|
|
14625
14451
|
var EnergyReportShard = require_energyReportShard2();
|
|
14626
|
-
var
|
|
14627
|
-
var EnergyReportDaily = require_energyReportDaily2();
|
|
14452
|
+
var EnergyReport = require_energyReport2();
|
|
14628
14453
|
var Property = require_property2();
|
|
14629
14454
|
var Organization = require_organization2();
|
|
14630
14455
|
module.exports = {
|
|
@@ -14655,8 +14480,7 @@ var require_Models = __commonJS({
|
|
|
14655
14480
|
Credential,
|
|
14656
14481
|
ShortLink,
|
|
14657
14482
|
EnergyReportShard,
|
|
14658
|
-
|
|
14659
|
-
EnergyReportDaily
|
|
14483
|
+
EnergyReport
|
|
14660
14484
|
};
|
|
14661
14485
|
}
|
|
14662
14486
|
});
|