@texturehq/device 1.13.0 → 1.15.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.
- package/dist/common/supportLevel.d.ts +8 -2
- package/dist/common/supportLevel.d.ts.map +1 -1
- package/dist/common/supportLevel.js +2 -2
- package/dist/common/supportLevel.js.map +1 -1
- package/dist/deviceModel/entities.d.ts +46 -189
- package/dist/deviceModel/entities.d.ts.map +1 -1
- package/dist/deviceModel/entities.js +7 -7
- package/dist/deviceModel/entities.js.map +1 -1
- package/dist/deviceState/battery.d.ts +34 -156
- package/dist/deviceState/battery.d.ts.map +1 -1
- package/dist/deviceState/battery.js +14 -14
- package/dist/deviceState/battery.js.map +1 -1
- package/dist/deviceState/charger.d.ts +9 -36
- package/dist/deviceState/charger.d.ts.map +1 -1
- package/dist/deviceState/charger.js +7 -7
- package/dist/deviceState/charger.js.map +1 -1
- package/dist/deviceState/common.d.ts +26 -14
- package/dist/deviceState/common.d.ts.map +1 -1
- package/dist/deviceState/common.js +7 -7
- package/dist/deviceState/common.js.map +1 -1
- package/dist/deviceState/inverter.d.ts +21 -72
- package/dist/deviceState/inverter.d.ts.map +1 -1
- package/dist/deviceState/inverter.js +6 -6
- package/dist/deviceState/inverter.js.map +1 -1
- package/dist/deviceState/meter.d.ts +36 -634
- package/dist/deviceState/meter.d.ts.map +1 -1
- package/dist/deviceState/meter.js +31 -31
- package/dist/deviceState/meter.js.map +1 -1
- package/dist/deviceState/thermostat.d.ts +33 -39
- package/dist/deviceState/thermostat.d.ts.map +1 -1
- package/dist/deviceState/thermostat.js +8 -8
- package/dist/deviceState/thermostat.js.map +1 -1
- package/dist/deviceState/vehicle.d.ts +10 -74
- package/dist/deviceState/vehicle.d.ts.map +1 -1
- package/dist/deviceState/vehicle.js +13 -14
- package/dist/deviceState/vehicle.js.map +1 -1
- package/dist/deviceType/entities.d.ts +11 -2
- package/dist/deviceType/entities.d.ts.map +1 -1
- package/dist/deviceType/entities.js +2 -2
- package/dist/deviceType/entities.js.map +1 -1
- package/dist/manufacturer/entities.d.ts +19 -103
- package/dist/manufacturer/entities.d.ts.map +1 -1
- package/dist/manufacturer/entities.js +20 -9
- package/dist/manufacturer/entities.js.map +1 -1
- package/dist/metrics/aggregations.d.ts +7 -2
- package/dist/metrics/aggregations.d.ts.map +1 -1
- package/dist/metrics/aggregations.js +2 -2
- package/dist/metrics/aggregations.js.map +1 -1
- package/dist/metrics/groupBy.d.ts +5 -2
- package/dist/metrics/groupBy.d.ts.map +1 -1
- package/dist/metrics/groupBy.js +2 -2
- package/dist/metrics/groupBy.js.map +1 -1
- package/dist/metrics/range.d.ts +5 -21
- package/dist/metrics/range.d.ts.map +1 -1
- package/dist/metrics/range.js +25 -46
- package/dist/metrics/range.js.map +1 -1
- package/dist/metrics/units.d.ts +26 -2
- package/dist/metrics/units.d.ts.map +1 -1
- package/dist/metrics/units.js +2 -2
- package/dist/metrics/units.js.map +1 -1
- package/dist/metrics/window.d.ts +19 -11
- package/dist/metrics/window.d.ts.map +1 -1
- package/dist/metrics/window.js +4 -4
- package/dist/metrics/window.js.map +1 -1
- package/package.json +7 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"battery.js","sourceRoot":"","sources":["../../src/deviceState/battery.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"battery.js","sourceRoot":"","sources":["../../src/deviceState/battery.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,qCAAgG;AAEnF,QAAA,sBAAsB,GAAG,MAAC,CAAC,MAAM,CAAC;IAC7C;;;OAGG;IACH,aAAa,EAAE,iCAAwB;IACvC;;;OAGG;IACH,MAAM,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IACpF;;;OAGG;IACH,gBAAgB,EAAE,MAAC;SAChB,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,CAAC,+FAA+F,CAAC;IAC5G;;;;;;;;;OASG;IACH,UAAU,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;IAClG;;;;OAIG;IACH,aAAa,EAAE,MAAC;SACb,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,4GAA4G,CAC7G;IACH;;;;OAIG;IACH,iBAAiB,EAAE,MAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC;IACzG;;;;OAIG;IACH,kBAAkB,EAAE,MAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;IAClG;;;OAGG;IACH,QAAQ,EAAE,8BAAqB,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC;AAEU,QAAA,kBAAkB,GAAG,8BAAsB,CAAC,MAAM,CAAC,4BAAmB,CAAC,KAAK,CAAC,CAAC;AAG9E,QAAA,wBAAwB,GAAG,MAAC,CAAC,MAAM,CAAC;IAC/C;;OAEG;IACH,QAAQ,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;IAC9F;;OAEG;IACH,aAAa,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;IAC3G;;OAEG;IACH,gBAAgB,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;IACjH;;OAEG;IACH,iBAAiB,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;CAC7G,CAAC,CAAC"}
|
|
@@ -1,44 +1,17 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
2
|
export declare const ChargerStateSchema: z.ZodObject<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Whether the charger is plugged in.
|
|
10
|
-
* @example true
|
|
11
|
-
*/
|
|
3
|
+
chargingState: z.ZodEnum<{
|
|
4
|
+
unknown: "unknown";
|
|
5
|
+
idle: "idle";
|
|
6
|
+
charging: "charging";
|
|
7
|
+
discharging: "discharging";
|
|
8
|
+
}>;
|
|
12
9
|
isPluggedIn: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
-
/**
|
|
14
|
-
* The voltage of the charger in volts (V).
|
|
15
|
-
* @example 240
|
|
16
|
-
*/
|
|
17
10
|
chargerVoltage: z.ZodOptional<z.ZodNumber>;
|
|
18
|
-
/**
|
|
19
|
-
* The current of the charger in amps (A).
|
|
20
|
-
* @example 40
|
|
21
|
-
*/
|
|
22
11
|
chargerCurrent: z.ZodOptional<z.ZodNumber>;
|
|
23
|
-
/**
|
|
24
|
-
* The wattage of the charger in watts (W).
|
|
25
|
-
* @example 7200
|
|
26
|
-
*/
|
|
27
12
|
chargerWattage: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
},
|
|
29
|
-
chargingState: "unknown" | "idle" | "charging" | "discharging";
|
|
30
|
-
isPluggedIn?: boolean | undefined;
|
|
31
|
-
chargerVoltage?: number | undefined;
|
|
32
|
-
chargerCurrent?: number | undefined;
|
|
33
|
-
chargerWattage?: number | undefined;
|
|
34
|
-
}, {
|
|
35
|
-
chargingState: "unknown" | "idle" | "charging" | "discharging";
|
|
36
|
-
isPluggedIn?: boolean | undefined;
|
|
37
|
-
chargerVoltage?: number | undefined;
|
|
38
|
-
chargerCurrent?: number | undefined;
|
|
39
|
-
chargerWattage?: number | undefined;
|
|
40
|
-
}>;
|
|
13
|
+
}, z.core.$strip>;
|
|
41
14
|
export type ChargerState = z.infer<typeof ChargerStateSchema>;
|
|
42
|
-
export declare const ChargerStaticStateSchema: z.ZodObject<{},
|
|
15
|
+
export declare const ChargerStaticStateSchema: z.ZodObject<{}, z.core.$strip>;
|
|
43
16
|
export type ChargerStaticState = z.infer<typeof ChargerStaticStateSchema>;
|
|
44
17
|
//# sourceMappingURL=charger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charger.d.ts","sourceRoot":"","sources":["../../src/deviceState/charger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"charger.d.ts","sourceRoot":"","sources":["../../src/deviceState/charger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,eAAO,MAAM,kBAAkB;;;;;;;;;;;iBA4B7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,wBAAwB,gCAAe,CAAC;AACrD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChargerStaticStateSchema = exports.ChargerStateSchema = void 0;
|
|
4
|
-
const
|
|
4
|
+
const v4_1 = require("zod/v4");
|
|
5
5
|
const common_1 = require("./common");
|
|
6
|
-
exports.ChargerStateSchema =
|
|
6
|
+
exports.ChargerStateSchema = v4_1.z.object({
|
|
7
7
|
/**
|
|
8
8
|
* Whether the charger is currently charging. The state could be unknown if not provided by the manufacturer.
|
|
9
9
|
* @example "charging"
|
|
@@ -13,22 +13,22 @@ exports.ChargerStateSchema = zod_1.z.object({
|
|
|
13
13
|
* Whether the charger is plugged in.
|
|
14
14
|
* @example true
|
|
15
15
|
*/
|
|
16
|
-
isPluggedIn:
|
|
16
|
+
isPluggedIn: v4_1.z.boolean().optional().describe("Whether the charger is plugged in."),
|
|
17
17
|
/**
|
|
18
18
|
* The voltage of the charger in volts (V).
|
|
19
19
|
* @example 240
|
|
20
20
|
*/
|
|
21
|
-
chargerVoltage:
|
|
21
|
+
chargerVoltage: v4_1.z.number().min(0).max(1_000).optional().describe("The voltage of the charger in volts (V)."),
|
|
22
22
|
/**
|
|
23
23
|
* The current of the charger in amps (A).
|
|
24
24
|
* @example 40
|
|
25
25
|
*/
|
|
26
|
-
chargerCurrent:
|
|
26
|
+
chargerCurrent: v4_1.z.number().min(0).max(1_000).optional().describe("The current of the charger in amps (A)."),
|
|
27
27
|
/**
|
|
28
28
|
* The wattage of the charger in watts (W).
|
|
29
29
|
* @example 7200
|
|
30
30
|
*/
|
|
31
|
-
chargerWattage:
|
|
31
|
+
chargerWattage: v4_1.z.number().min(0).max(100_000).optional().describe("The wattage of the charger in watts (W)."),
|
|
32
32
|
});
|
|
33
|
-
exports.ChargerStaticStateSchema =
|
|
33
|
+
exports.ChargerStaticStateSchema = v4_1.z.object({});
|
|
34
34
|
//# sourceMappingURL=charger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charger.js","sourceRoot":"","sources":["../../src/deviceState/charger.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"charger.js","sourceRoot":"","sources":["../../src/deviceState/charger.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,qCAAoD;AAEvC,QAAA,kBAAkB,GAAG,MAAC,CAAC,MAAM,CAAC;IACzC;;;OAGG;IACH,aAAa,EAAE,iCAAwB,CAAC,QAAQ,CAC9C,4GAA4G,CAC7G;IACD;;;OAGG;IACH,WAAW,EAAE,MAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IAClF;;;OAGG;IACH,cAAc,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;IAC5G;;;OAGG;IACH,cAAc,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAC3G;;;OAGG;IACH,cAAc,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;CAC/G,CAAC,CAAC;AAGU,QAAA,wBAAwB,GAAG,MAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
2
|
/**
|
|
3
3
|
* The grid status.
|
|
4
4
|
* Shared for the inverter and battery devices.
|
|
5
5
|
* @example "exporting"
|
|
6
6
|
*/
|
|
7
7
|
export declare const GridStatuses: readonly ["exporting", "importing", "idle", "unknown"];
|
|
8
|
-
export declare const GridStatusEnum: z.ZodEnum<
|
|
8
|
+
export declare const GridStatusEnum: z.ZodEnum<{
|
|
9
|
+
unknown: "unknown";
|
|
10
|
+
idle: "idle";
|
|
11
|
+
exporting: "exporting";
|
|
12
|
+
importing: "importing";
|
|
13
|
+
}>;
|
|
9
14
|
export type GridStatus = z.infer<typeof GridStatusEnum>;
|
|
10
15
|
/**
|
|
11
16
|
* The recent estimate of power output to/from the grid in Watts (W).
|
|
@@ -23,7 +28,12 @@ export declare const GridEnergy: z.ZodNumber;
|
|
|
23
28
|
* @example "charging"
|
|
24
29
|
*/
|
|
25
30
|
export declare const BatteryChargingState: readonly ["charging", "discharging", "idle", "unknown"];
|
|
26
|
-
export declare const BatteryChargingStateEnum: z.ZodEnum<
|
|
31
|
+
export declare const BatteryChargingStateEnum: z.ZodEnum<{
|
|
32
|
+
unknown: "unknown";
|
|
33
|
+
idle: "idle";
|
|
34
|
+
charging: "charging";
|
|
35
|
+
discharging: "discharging";
|
|
36
|
+
}>;
|
|
27
37
|
export type BatteryChargingState = z.infer<typeof BatteryChargingStateEnum>;
|
|
28
38
|
/**
|
|
29
39
|
* Battery strategies or modes.
|
|
@@ -32,19 +42,21 @@ export type BatteryChargingState = z.infer<typeof BatteryChargingStateEnum>;
|
|
|
32
42
|
* But below are some of the most common strategies and modes that batteries offer in some form.
|
|
33
43
|
*/
|
|
34
44
|
export declare const BatteryStrategies: readonly ["unknown", "self_consumption", "time_of_use", "backup"];
|
|
35
|
-
export declare const BatteryStrategiesEnum: z.ZodDefault<z.ZodEnum<
|
|
45
|
+
export declare const BatteryStrategiesEnum: z.ZodDefault<z.ZodEnum<{
|
|
46
|
+
unknown: "unknown";
|
|
47
|
+
self_consumption: "self_consumption";
|
|
48
|
+
time_of_use: "time_of_use";
|
|
49
|
+
backup: "backup";
|
|
50
|
+
}>>;
|
|
36
51
|
export type BatteryStrategy = z.infer<typeof BatteryStrategiesEnum>;
|
|
37
52
|
export declare const CoreGridStateSchema: z.ZodObject<{
|
|
38
|
-
gridStatus: z.ZodOptional<z.ZodEnum<
|
|
53
|
+
gridStatus: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
unknown: "unknown";
|
|
55
|
+
idle: "idle";
|
|
56
|
+
exporting: "exporting";
|
|
57
|
+
importing: "importing";
|
|
58
|
+
}>>;
|
|
39
59
|
gridPower: z.ZodOptional<z.ZodNumber>;
|
|
40
60
|
gridEnergy: z.ZodOptional<z.ZodNumber>;
|
|
41
|
-
},
|
|
42
|
-
gridStatus?: "unknown" | "idle" | "exporting" | "importing" | undefined;
|
|
43
|
-
gridPower?: number | undefined;
|
|
44
|
-
gridEnergy?: number | undefined;
|
|
45
|
-
}, {
|
|
46
|
-
gridStatus?: "unknown" | "idle" | "exporting" | "importing" | undefined;
|
|
47
|
-
gridPower?: number | undefined;
|
|
48
|
-
gridEnergy?: number | undefined;
|
|
49
|
-
}>;
|
|
61
|
+
}, z.core.$strip>;
|
|
50
62
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/deviceState/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/deviceState/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B;;;;GAIG;AACH,eAAO,MAAM,YAAY,wDAAyD,CAAC;AACnF,eAAO,MAAM,cAAc;;;;;EAEkD,CAAC;AAC9E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,SAAS,aAKnB,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,UAAU,aAAsF,CAAC;AAE9G;;;GAGG;AACH,eAAO,MAAM,oBAAoB,yDAA0D,CAAC;AAC5F,eAAO,MAAM,wBAAwB;;;;;EAIlC,CAAC;AACJ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,mEAWpB,CAAC;AACX,eAAO,MAAM,qBAAqB;;;;;GAGsC,CAAC;AACzE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;;;iBAiB9B,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoreGridStateSchema = exports.BatteryStrategiesEnum = exports.BatteryStrategies = exports.BatteryChargingStateEnum = exports.BatteryChargingState = exports.GridEnergy = exports.GridPower = exports.GridStatusEnum = exports.GridStatuses = void 0;
|
|
4
|
-
const
|
|
4
|
+
const v4_1 = require("zod/v4");
|
|
5
5
|
/**
|
|
6
6
|
* The grid status.
|
|
7
7
|
* Shared for the inverter and battery devices.
|
|
8
8
|
* @example "exporting"
|
|
9
9
|
*/
|
|
10
10
|
exports.GridStatuses = ["exporting", "importing", "idle", "unknown"];
|
|
11
|
-
exports.GridStatusEnum =
|
|
11
|
+
exports.GridStatusEnum = v4_1.z
|
|
12
12
|
.enum(exports.GridStatuses)
|
|
13
13
|
.describe("The current grid status (importing, exporting, idle, unknown).");
|
|
14
14
|
/**
|
|
@@ -16,7 +16,7 @@ exports.GridStatusEnum = zod_1.z
|
|
|
16
16
|
* Positive values indicate importing from the grid, negative values indicate exporting to the grid.
|
|
17
17
|
* @example 5000
|
|
18
18
|
*/
|
|
19
|
-
exports.GridPower =
|
|
19
|
+
exports.GridPower = v4_1.z
|
|
20
20
|
.number()
|
|
21
21
|
.int()
|
|
22
22
|
.describe("The recent estimate of power output to/from the grid in Watts (W). Positive values indicate importing from the grid, negative values indicate exporting to the grid.");
|
|
@@ -24,13 +24,13 @@ exports.GridPower = zod_1.z
|
|
|
24
24
|
* Estimated recent grid energy usage in Watt-hours (Wh).
|
|
25
25
|
* @example 5000
|
|
26
26
|
*/
|
|
27
|
-
exports.GridEnergy =
|
|
27
|
+
exports.GridEnergy = v4_1.z.number().int().describe("Estimated recent grid energy usage in Watt-hours (Wh).");
|
|
28
28
|
/**
|
|
29
29
|
* The charging state.
|
|
30
30
|
* @example "charging"
|
|
31
31
|
*/
|
|
32
32
|
exports.BatteryChargingState = ["charging", "discharging", "idle", "unknown"];
|
|
33
|
-
exports.BatteryChargingStateEnum =
|
|
33
|
+
exports.BatteryChargingStateEnum = v4_1.z
|
|
34
34
|
.enum(exports.BatteryChargingState)
|
|
35
35
|
.describe("Whether the battery is currently charging. The state could be unknown if not provided by the manufacturer.");
|
|
36
36
|
/**
|
|
@@ -51,11 +51,11 @@ exports.BatteryStrategies = [
|
|
|
51
51
|
// With this strategy, the main goal is to keep the battery charged to a certain level (typically 100%) to be prepared for a power outage.
|
|
52
52
|
"backup",
|
|
53
53
|
];
|
|
54
|
-
exports.BatteryStrategiesEnum =
|
|
54
|
+
exports.BatteryStrategiesEnum = v4_1.z
|
|
55
55
|
.enum(exports.BatteryStrategies)
|
|
56
56
|
.default("unknown")
|
|
57
57
|
.describe("The current strategy or mode the battery is operating in.");
|
|
58
|
-
exports.CoreGridStateSchema =
|
|
58
|
+
exports.CoreGridStateSchema = v4_1.z.object({
|
|
59
59
|
// /**
|
|
60
60
|
// * The current grid status (importing, exporting, idle, unknown).
|
|
61
61
|
// * @example "exporting"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/deviceState/common.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/deviceState/common.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAE3B;;;;GAIG;AACU,QAAA,YAAY,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AACtE,QAAA,cAAc,GAAG,MAAC;KAC5B,IAAI,CAAC,oBAAY,CAAC;KAClB,QAAQ,CAAC,gEAAgE,CAAC,CAAC;AAG9E;;;;GAIG;AACU,QAAA,SAAS,GAAG,MAAC;KACvB,MAAM,EAAE;KACR,GAAG,EAAE;KACL,QAAQ,CACP,sKAAsK,CACvK,CAAC;AAEJ;;;GAGG;AACU,QAAA,UAAU,GAAG,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC,CAAC;AAE9G;;;GAGG;AACU,QAAA,oBAAoB,GAAG,CAAC,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAC/E,QAAA,wBAAwB,GAAG,MAAC;KACtC,IAAI,CAAC,4BAAoB,CAAC;KAC1B,QAAQ,CACP,4GAA4G,CAC7G,CAAC;AAGJ;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG;IAC/B,oFAAoF;IACpF,SAAS;IACT,6FAA6F;IAC7F,uFAAuF;IACvF,kBAAkB;IAClB,4HAA4H;IAC5H,sHAAsH;IACtH,aAAa;IACb,0IAA0I;IAC1I,QAAQ;CACA,CAAC;AACE,QAAA,qBAAqB,GAAG,MAAC;KACnC,IAAI,CAAC,yBAAiB,CAAC;KACvB,OAAO,CAAC,SAAS,CAAC;KAClB,QAAQ,CAAC,2DAA2D,CAAC,CAAC;AAG5D,QAAA,mBAAmB,GAAG,MAAC,CAAC,MAAM,CAAC;IAC1C,MAAM;IACN,oEAAoE;IACpE,0BAA0B;IAC1B,MAAM;IACN,UAAU,EAAE,sBAAc,CAAC,QAAQ,EAAE;IACrC,MAAM;IACN,wEAAwE;IACxE,uGAAuG;IACvG,mBAAmB;IACnB,MAAM;IACN,SAAS,EAAE,iBAAS,CAAC,QAAQ,EAAE;IAC/B,MAAM;IACN,4DAA4D;IAC5D,mBAAmB;IACnB,MAAM;IACN,UAAU,EAAE,kBAAU,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"}
|
|
@@ -1,89 +1,38 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
2
|
export declare const InverterStateSchema: z.ZodObject<{
|
|
3
|
-
/**
|
|
4
|
-
* The power output of the inverter in watts (W).
|
|
5
|
-
* @example 5000
|
|
6
|
-
*/
|
|
7
3
|
power: z.ZodNumber;
|
|
8
|
-
/**
|
|
9
|
-
* The current state of the battery (mostly for hybrid inverters with battery backup support).
|
|
10
|
-
* @optional
|
|
11
|
-
* @example { charge: 43200, chargePercentage: 50, chargingState: "charging" }
|
|
12
|
-
*/
|
|
13
4
|
batteryState: z.ZodOptional<z.ZodObject<{
|
|
14
|
-
chargingState: z.ZodEnum<
|
|
5
|
+
chargingState: z.ZodEnum<{
|
|
6
|
+
unknown: "unknown";
|
|
7
|
+
idle: "idle";
|
|
8
|
+
charging: "charging";
|
|
9
|
+
discharging: "discharging";
|
|
10
|
+
}>;
|
|
15
11
|
charge: z.ZodNumber;
|
|
16
12
|
chargePercentage: z.ZodNumber;
|
|
17
13
|
chargeRate: z.ZodOptional<z.ZodNumber>;
|
|
18
14
|
backupReserve: z.ZodOptional<z.ZodNumber>;
|
|
19
15
|
isStormModeActive: z.ZodOptional<z.ZodBoolean>;
|
|
20
16
|
isStormModeEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
-
strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
charge: number;
|
|
34
|
-
chargePercentage: number;
|
|
35
|
-
chargeRate?: number | undefined;
|
|
36
|
-
backupReserve?: number | undefined;
|
|
37
|
-
isStormModeActive?: boolean | undefined;
|
|
38
|
-
isStormModeEnabled?: boolean | undefined;
|
|
39
|
-
strategy?: "unknown" | "self_consumption" | "time_of_use" | "backup" | undefined;
|
|
17
|
+
strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
18
|
+
unknown: "unknown";
|
|
19
|
+
self_consumption: "self_consumption";
|
|
20
|
+
time_of_use: "time_of_use";
|
|
21
|
+
backup: "backup";
|
|
22
|
+
}>>>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
gridStatus: z.ZodOptional<z.ZodEnum<{
|
|
25
|
+
unknown: "unknown";
|
|
26
|
+
idle: "idle";
|
|
27
|
+
exporting: "exporting";
|
|
28
|
+
importing: "importing";
|
|
40
29
|
}>>;
|
|
41
|
-
} & {
|
|
42
|
-
gridStatus: z.ZodOptional<z.ZodEnum<["exporting", "importing", "idle", "unknown"]>>;
|
|
43
30
|
gridPower: z.ZodOptional<z.ZodNumber>;
|
|
44
31
|
gridEnergy: z.ZodOptional<z.ZodNumber>;
|
|
45
|
-
},
|
|
46
|
-
power: number;
|
|
47
|
-
gridStatus?: "unknown" | "idle" | "exporting" | "importing" | undefined;
|
|
48
|
-
gridPower?: number | undefined;
|
|
49
|
-
gridEnergy?: number | undefined;
|
|
50
|
-
batteryState?: {
|
|
51
|
-
chargingState: "unknown" | "idle" | "charging" | "discharging";
|
|
52
|
-
charge: number;
|
|
53
|
-
chargePercentage: number;
|
|
54
|
-
chargeRate?: number | undefined;
|
|
55
|
-
backupReserve?: number | undefined;
|
|
56
|
-
isStormModeActive?: boolean | undefined;
|
|
57
|
-
isStormModeEnabled?: boolean | undefined;
|
|
58
|
-
strategy?: "unknown" | "self_consumption" | "time_of_use" | "backup" | undefined;
|
|
59
|
-
} | undefined;
|
|
60
|
-
}, {
|
|
61
|
-
power: number;
|
|
62
|
-
gridStatus?: "unknown" | "idle" | "exporting" | "importing" | undefined;
|
|
63
|
-
gridPower?: number | undefined;
|
|
64
|
-
gridEnergy?: number | undefined;
|
|
65
|
-
batteryState?: {
|
|
66
|
-
chargingState: "unknown" | "idle" | "charging" | "discharging";
|
|
67
|
-
charge: number;
|
|
68
|
-
chargePercentage: number;
|
|
69
|
-
chargeRate?: number | undefined;
|
|
70
|
-
backupReserve?: number | undefined;
|
|
71
|
-
isStormModeActive?: boolean | undefined;
|
|
72
|
-
isStormModeEnabled?: boolean | undefined;
|
|
73
|
-
strategy?: "unknown" | "self_consumption" | "time_of_use" | "backup" | undefined;
|
|
74
|
-
} | undefined;
|
|
75
|
-
}>;
|
|
32
|
+
}, z.core.$strip>;
|
|
76
33
|
export type InverterState = z.infer<typeof InverterStateSchema>;
|
|
77
34
|
export declare const InverterStaticStateSchema: z.ZodObject<{
|
|
78
|
-
/**
|
|
79
|
-
* The maximum power output of the inverter in watts (W).
|
|
80
|
-
* @example 5000
|
|
81
|
-
*/
|
|
82
35
|
power: z.ZodNumber;
|
|
83
|
-
},
|
|
84
|
-
power: number;
|
|
85
|
-
}, {
|
|
86
|
-
power: number;
|
|
87
|
-
}>;
|
|
36
|
+
}, z.core.$strip>;
|
|
88
37
|
export type InverterStaticState = z.infer<typeof InverterStaticStateSchema>;
|
|
89
38
|
//# sourceMappingURL=inverter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inverter.d.ts","sourceRoot":"","sources":["../../src/deviceState/inverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"inverter.d.ts","sourceRoot":"","sources":["../../src/deviceState/inverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAI3B,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAeI,CAAC;AACrC,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,yBAAyB;;iBAMpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InverterStaticStateSchema = exports.InverterStateSchema = void 0;
|
|
4
|
-
const
|
|
4
|
+
const v4_1 = require("zod/v4");
|
|
5
5
|
const battery_1 = require("./battery");
|
|
6
6
|
const common_1 = require("./common");
|
|
7
|
-
exports.InverterStateSchema =
|
|
7
|
+
exports.InverterStateSchema = v4_1.z
|
|
8
8
|
.object({
|
|
9
9
|
/**
|
|
10
10
|
* The power output of the inverter in watts (W).
|
|
11
11
|
* @example 5000
|
|
12
12
|
*/
|
|
13
|
-
power:
|
|
13
|
+
power: v4_1.z.number().min(0).max(10_000_000).describe("The power output of the inverter in watts (W)."),
|
|
14
14
|
/**
|
|
15
15
|
* The current state of the battery (mostly for hybrid inverters with battery backup support).
|
|
16
16
|
* @optional
|
|
@@ -19,12 +19,12 @@ exports.InverterStateSchema = zod_1.z
|
|
|
19
19
|
batteryState: battery_1.CoreBatteryStateSchema.optional(),
|
|
20
20
|
})
|
|
21
21
|
// attach grid state to inverter state
|
|
22
|
-
.
|
|
23
|
-
exports.InverterStaticStateSchema =
|
|
22
|
+
.extend(common_1.CoreGridStateSchema.shape);
|
|
23
|
+
exports.InverterStaticStateSchema = v4_1.z.object({
|
|
24
24
|
/**
|
|
25
25
|
* The maximum power output of the inverter in watts (W).
|
|
26
26
|
* @example 5000
|
|
27
27
|
*/
|
|
28
|
-
power:
|
|
28
|
+
power: v4_1.z.number().min(0).max(10_000_000).describe("The maximum power output of the inverter in watts (W)."),
|
|
29
29
|
});
|
|
30
30
|
//# sourceMappingURL=inverter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inverter.js","sourceRoot":"","sources":["../../src/deviceState/inverter.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"inverter.js","sourceRoot":"","sources":["../../src/deviceState/inverter.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,uCAAmD;AACnD,qCAA+C;AAElC,QAAA,mBAAmB,GAAG,MAAC;KACjC,MAAM,CAAC;IACN;;;OAGG;IACH,KAAK,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IACnG;;;;OAIG;IACH,YAAY,EAAE,gCAAsB,CAAC,QAAQ,EAAE;CAChD,CAAC;IACF,sCAAsC;KACrC,MAAM,CAAC,4BAAmB,CAAC,KAAK,CAAC,CAAC;AAGxB,QAAA,yBAAyB,GAAG,MAAC,CAAC,MAAM,CAAC;IAChD;;;OAGG;IACH,KAAK,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,wDAAwD,CAAC;CAC5G,CAAC,CAAC"}
|