@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.
Files changed (65) hide show
  1. package/dist/common/supportLevel.d.ts +8 -2
  2. package/dist/common/supportLevel.d.ts.map +1 -1
  3. package/dist/common/supportLevel.js +2 -2
  4. package/dist/common/supportLevel.js.map +1 -1
  5. package/dist/deviceModel/entities.d.ts +46 -189
  6. package/dist/deviceModel/entities.d.ts.map +1 -1
  7. package/dist/deviceModel/entities.js +7 -7
  8. package/dist/deviceModel/entities.js.map +1 -1
  9. package/dist/deviceState/battery.d.ts +34 -156
  10. package/dist/deviceState/battery.d.ts.map +1 -1
  11. package/dist/deviceState/battery.js +14 -14
  12. package/dist/deviceState/battery.js.map +1 -1
  13. package/dist/deviceState/charger.d.ts +9 -36
  14. package/dist/deviceState/charger.d.ts.map +1 -1
  15. package/dist/deviceState/charger.js +7 -7
  16. package/dist/deviceState/charger.js.map +1 -1
  17. package/dist/deviceState/common.d.ts +26 -14
  18. package/dist/deviceState/common.d.ts.map +1 -1
  19. package/dist/deviceState/common.js +7 -7
  20. package/dist/deviceState/common.js.map +1 -1
  21. package/dist/deviceState/inverter.d.ts +21 -72
  22. package/dist/deviceState/inverter.d.ts.map +1 -1
  23. package/dist/deviceState/inverter.js +6 -6
  24. package/dist/deviceState/inverter.js.map +1 -1
  25. package/dist/deviceState/meter.d.ts +36 -634
  26. package/dist/deviceState/meter.d.ts.map +1 -1
  27. package/dist/deviceState/meter.js +31 -31
  28. package/dist/deviceState/meter.js.map +1 -1
  29. package/dist/deviceState/thermostat.d.ts +33 -39
  30. package/dist/deviceState/thermostat.d.ts.map +1 -1
  31. package/dist/deviceState/thermostat.js +8 -8
  32. package/dist/deviceState/thermostat.js.map +1 -1
  33. package/dist/deviceState/vehicle.d.ts +10 -74
  34. package/dist/deviceState/vehicle.d.ts.map +1 -1
  35. package/dist/deviceState/vehicle.js +13 -14
  36. package/dist/deviceState/vehicle.js.map +1 -1
  37. package/dist/deviceType/entities.d.ts +11 -2
  38. package/dist/deviceType/entities.d.ts.map +1 -1
  39. package/dist/deviceType/entities.js +2 -2
  40. package/dist/deviceType/entities.js.map +1 -1
  41. package/dist/manufacturer/entities.d.ts +19 -103
  42. package/dist/manufacturer/entities.d.ts.map +1 -1
  43. package/dist/manufacturer/entities.js +20 -9
  44. package/dist/manufacturer/entities.js.map +1 -1
  45. package/dist/metrics/aggregations.d.ts +7 -2
  46. package/dist/metrics/aggregations.d.ts.map +1 -1
  47. package/dist/metrics/aggregations.js +2 -2
  48. package/dist/metrics/aggregations.js.map +1 -1
  49. package/dist/metrics/groupBy.d.ts +5 -2
  50. package/dist/metrics/groupBy.d.ts.map +1 -1
  51. package/dist/metrics/groupBy.js +2 -2
  52. package/dist/metrics/groupBy.js.map +1 -1
  53. package/dist/metrics/range.d.ts +5 -21
  54. package/dist/metrics/range.d.ts.map +1 -1
  55. package/dist/metrics/range.js +25 -46
  56. package/dist/metrics/range.js.map +1 -1
  57. package/dist/metrics/units.d.ts +26 -2
  58. package/dist/metrics/units.d.ts.map +1 -1
  59. package/dist/metrics/units.js +2 -2
  60. package/dist/metrics/units.js.map +1 -1
  61. package/dist/metrics/window.d.ts +19 -11
  62. package/dist/metrics/window.d.ts.map +1 -1
  63. package/dist/metrics/window.js +4 -4
  64. package/dist/metrics/window.js.map +1 -1
  65. package/package.json +7 -4
@@ -1,6 +1,12 @@
1
- import { z } from "zod";
1
+ import { z } from "zod/v4";
2
2
  export declare const SupportLevels: readonly ["planned", "development", "uat", "production", "blocked"];
3
3
  export type SupportLevel = (typeof SupportLevels)[number];
4
- export declare const SupportLevelEnum: z.ZodEnum<["planned", "development", "uat", "production", "blocked"]>;
4
+ export declare const SupportLevelEnum: z.ZodEnum<{
5
+ blocked: "blocked";
6
+ planned: "planned";
7
+ development: "development";
8
+ uat: "uat";
9
+ production: "production";
10
+ }>;
5
11
  export declare const SupportLevelLabelMap: Record<SupportLevel, string>;
6
12
  //# sourceMappingURL=supportLevel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"supportLevel.d.ts","sourceRoot":"","sources":["../../src/common/supportLevel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa,qEAAsE,CAAC;AACjG,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1D,eAAO,MAAM,gBAAgB,uEAAwB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAM7D,CAAC"}
1
+ {"version":3,"file":"supportLevel.d.ts","sourceRoot":"","sources":["../../src/common/supportLevel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,aAAa,qEAAsE,CAAC;AACjG,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1D,eAAO,MAAM,gBAAgB;;;;;;EAAwB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAM7D,CAAC"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SupportLevelLabelMap = exports.SupportLevelEnum = exports.SupportLevels = void 0;
4
- const zod_1 = require("zod");
4
+ const v4_1 = require("zod/v4");
5
5
  exports.SupportLevels = ["planned", "development", "uat", "production", "blocked"];
6
- exports.SupportLevelEnum = zod_1.z.enum(exports.SupportLevels);
6
+ exports.SupportLevelEnum = v4_1.z.enum(exports.SupportLevels);
7
7
  exports.SupportLevelLabelMap = {
8
8
  planned: "Planned",
9
9
  blocked: "Blocked",
@@ -1 +1 @@
1
- {"version":3,"file":"supportLevel.js","sourceRoot":"","sources":["../../src/common/supportLevel.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,aAAa,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,CAAU,CAAC;AAEpF,QAAA,gBAAgB,GAAG,OAAC,CAAC,IAAI,CAAC,qBAAa,CAAC,CAAC;AAEzC,QAAA,oBAAoB,GAAiC;IAChE,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;IAC1B,GAAG,EAAE,yBAAyB;IAC9B,UAAU,EAAE,YAAY;CACzB,CAAC"}
1
+ {"version":3,"file":"supportLevel.js","sourceRoot":"","sources":["../../src/common/supportLevel.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAEd,QAAA,aAAa,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,CAAU,CAAC;AAEpF,QAAA,gBAAgB,GAAG,MAAC,CAAC,IAAI,CAAC,qBAAa,CAAC,CAAC;AAEzC,QAAA,oBAAoB,GAAiC;IAChE,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;IAC1B,GAAG,EAAE,yBAAyB;IAC9B,UAAU,EAAE,YAAY;CACzB,CAAC"}
@@ -1,211 +1,68 @@
1
- import { z } from "zod";
1
+ import { z } from "zod/v4";
2
2
  export declare const AvailableCommandSchema: z.ZodObject<{
3
- /**
4
- * The unique identifier for the command.
5
- */
6
- slug: z.ZodEffects<z.ZodString, string, string>;
7
- support_level: z.ZodEnum<["planned", "development", "uat", "production", "blocked"]>;
8
- }, "strip", z.ZodTypeAny, {
9
- slug: string;
10
- support_level: "blocked" | "planned" | "development" | "uat" | "production";
11
- }, {
12
- slug: string;
13
- support_level: "blocked" | "planned" | "development" | "uat" | "production";
14
- }>;
3
+ slug: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
4
+ support_level: z.ZodEnum<{
5
+ blocked: "blocked";
6
+ planned: "planned";
7
+ development: "development";
8
+ uat: "uat";
9
+ production: "production";
10
+ }>;
11
+ }, z.core.$strip>;
15
12
  export declare const DeviceModelSchema: z.ZodObject<{
16
- /**
17
- * The unique identifier for the device model.
18
- * @example "tesla:panel"
19
- */
20
13
  slug: z.ZodString;
21
- /**
22
- * The human readable name of the manufacturer.
23
- * @example "PV Panel"
24
- */
25
14
  name: z.ZodString;
26
- /**
27
- * The type of the device.
28
- * @example "inverter"
29
- */
30
- type: z.ZodEnum<["battery", "charger", "inverter", "meter", "thermostat", "vehicle", "other", "unknown"]>;
31
- /**
32
- * The manufacturer of the device.
33
- */
15
+ type: z.ZodEnum<{
16
+ other: "other";
17
+ unknown: "unknown";
18
+ meter: "meter";
19
+ battery: "battery";
20
+ charger: "charger";
21
+ inverter: "inverter";
22
+ thermostat: "thermostat";
23
+ vehicle: "vehicle";
24
+ }>;
34
25
  manufacturer: z.ZodObject<{
26
+ id: z.ZodOptional<z.ZodString>;
35
27
  slug: z.ZodString;
36
28
  name: z.ZodString;
37
- supportLevel: z.ZodEnum<["planned", "development", "uat", "production", "blocked"]>;
29
+ supportLevel: z.ZodEnum<{
30
+ blocked: "blocked";
31
+ planned: "planned";
32
+ development: "development";
33
+ uat: "uat";
34
+ production: "production";
35
+ }>;
36
+ supportsGridServices: z.ZodOptional<z.ZodBoolean>;
38
37
  logo: z.ZodObject<{
39
- url: z.ZodString;
38
+ url: z.ZodURL;
40
39
  alt: z.ZodString;
41
40
  width: z.ZodNumber;
42
41
  height: z.ZodNumber;
43
- }, "strip", z.ZodTypeAny, {
44
- height: number;
45
- width: number;
46
- url: string;
47
- alt: string;
48
- }, {
49
- height: number;
50
- width: number;
51
- url: string;
52
- alt: string;
53
- }>;
42
+ }, z.core.$strip>;
54
43
  icon: z.ZodObject<{
55
- url: z.ZodString;
44
+ url: z.ZodURL;
56
45
  alt: z.ZodString;
57
46
  width: z.ZodNumber;
58
47
  height: z.ZodNumber;
59
- }, "strip", z.ZodTypeAny, {
60
- height: number;
61
- width: number;
62
- url: string;
63
- alt: string;
64
- }, {
65
- height: number;
66
- width: number;
67
- url: string;
68
- alt: string;
69
- }>;
48
+ }, z.core.$strip>;
70
49
  vectorIcon: z.ZodObject<{
71
- url: z.ZodString;
50
+ url: z.ZodURL;
72
51
  alt: z.ZodString;
73
52
  width: z.ZodNumber;
74
53
  height: z.ZodNumber;
75
- }, "strip", z.ZodTypeAny, {
76
- height: number;
77
- width: number;
78
- url: string;
79
- alt: string;
80
- }, {
81
- height: number;
82
- width: number;
83
- url: string;
84
- alt: string;
85
- }>;
86
- }, "strip", z.ZodTypeAny, {
87
- name: string;
88
- slug: string;
89
- logo: {
90
- height: number;
91
- width: number;
92
- url: string;
93
- alt: string;
94
- };
95
- icon: {
96
- height: number;
97
- width: number;
98
- url: string;
99
- alt: string;
100
- };
101
- supportLevel: "blocked" | "planned" | "development" | "uat" | "production";
102
- vectorIcon: {
103
- height: number;
104
- width: number;
105
- url: string;
106
- alt: string;
107
- };
108
- }, {
109
- name: string;
110
- slug: string;
111
- logo: {
112
- height: number;
113
- width: number;
114
- url: string;
115
- alt: string;
116
- };
117
- icon: {
118
- height: number;
119
- width: number;
120
- url: string;
121
- alt: string;
122
- };
123
- supportLevel: "blocked" | "planned" | "development" | "uat" | "production";
124
- vectorIcon: {
125
- height: number;
126
- width: number;
127
- url: string;
128
- alt: string;
129
- };
130
- }>;
131
- /**
132
- * The commands available for the device.
133
- */
54
+ }, z.core.$strip>;
55
+ }, z.core.$strip>;
134
56
  available_commands: z.ZodArray<z.ZodObject<{
135
- /**
136
- * The unique identifier for the command.
137
- */
138
- slug: z.ZodEffects<z.ZodString, string, string>;
139
- support_level: z.ZodEnum<["planned", "development", "uat", "production", "blocked"]>;
140
- }, "strip", z.ZodTypeAny, {
141
- slug: string;
142
- support_level: "blocked" | "planned" | "development" | "uat" | "production";
143
- }, {
144
- slug: string;
145
- support_level: "blocked" | "planned" | "development" | "uat" | "production";
146
- }>, "many">;
147
- }, "strip", z.ZodTypeAny, {
148
- name: string;
149
- type: "other" | "unknown" | "meter" | "battery" | "charger" | "inverter" | "thermostat" | "vehicle";
150
- slug: string;
151
- manufacturer: {
152
- name: string;
153
- slug: string;
154
- logo: {
155
- height: number;
156
- width: number;
157
- url: string;
158
- alt: string;
159
- };
160
- icon: {
161
- height: number;
162
- width: number;
163
- url: string;
164
- alt: string;
165
- };
166
- supportLevel: "blocked" | "planned" | "development" | "uat" | "production";
167
- vectorIcon: {
168
- height: number;
169
- width: number;
170
- url: string;
171
- alt: string;
172
- };
173
- };
174
- available_commands: {
175
- slug: string;
176
- support_level: "blocked" | "planned" | "development" | "uat" | "production";
177
- }[];
178
- }, {
179
- name: string;
180
- type: "other" | "unknown" | "meter" | "battery" | "charger" | "inverter" | "thermostat" | "vehicle";
181
- slug: string;
182
- manufacturer: {
183
- name: string;
184
- slug: string;
185
- logo: {
186
- height: number;
187
- width: number;
188
- url: string;
189
- alt: string;
190
- };
191
- icon: {
192
- height: number;
193
- width: number;
194
- url: string;
195
- alt: string;
196
- };
197
- supportLevel: "blocked" | "planned" | "development" | "uat" | "production";
198
- vectorIcon: {
199
- height: number;
200
- width: number;
201
- url: string;
202
- alt: string;
203
- };
204
- };
205
- available_commands: {
206
- slug: string;
207
- support_level: "blocked" | "planned" | "development" | "uat" | "production";
208
- }[];
209
- }>;
57
+ slug: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
58
+ support_level: z.ZodEnum<{
59
+ blocked: "blocked";
60
+ planned: "planned";
61
+ development: "development";
62
+ uat: "uat";
63
+ production: "production";
64
+ }>;
65
+ }, z.core.$strip>>;
66
+ }, z.core.$strip>;
210
67
  export type DeviceModel = z.infer<typeof DeviceModelSchema>;
211
68
  //# sourceMappingURL=entities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/deviceModel/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,sBAAsB;IACjC;;OAEG;;;;;;;;;EAGH,CAAC;AAEH,eAAO,MAAM,iBAAiB;IAC5B;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;OAEG;;QA7BH;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BH,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/deviceModel/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAM3B,eAAO,MAAM,sBAAsB;;;;;;;;;iBAMjC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwB5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -1,29 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DeviceModelSchema = exports.AvailableCommandSchema = void 0;
4
- const zod_1 = require("zod");
4
+ const v4_1 = require("zod/v4");
5
5
  const entities_1 = require("../deviceType/entities");
6
6
  const entities_2 = require("../manufacturer/entities");
7
7
  const supportLevel_1 = require("../common/supportLevel");
8
8
  const utils_1 = require("../common/utils");
9
- exports.AvailableCommandSchema = zod_1.z.object({
9
+ exports.AvailableCommandSchema = v4_1.z.object({
10
10
  /**
11
11
  * The unique identifier for the command.
12
12
  */
13
- slug: zod_1.z.string().transform(utils_1.fromGraphQLSafeString),
13
+ slug: v4_1.z.string().transform(utils_1.fromGraphQLSafeString),
14
14
  support_level: supportLevel_1.SupportLevelEnum,
15
15
  });
16
- exports.DeviceModelSchema = zod_1.z.object({
16
+ exports.DeviceModelSchema = v4_1.z.object({
17
17
  /**
18
18
  * The unique identifier for the device model.
19
19
  * @example "tesla:panel"
20
20
  */
21
- slug: zod_1.z.string(),
21
+ slug: v4_1.z.string(),
22
22
  /**
23
23
  * The human readable name of the manufacturer.
24
24
  * @example "PV Panel"
25
25
  */
26
- name: zod_1.z.string(),
26
+ name: v4_1.z.string(),
27
27
  /**
28
28
  * The type of the device.
29
29
  * @example "inverter"
@@ -36,6 +36,6 @@ exports.DeviceModelSchema = zod_1.z.object({
36
36
  /**
37
37
  * The commands available for the device.
38
38
  */
39
- available_commands: zod_1.z.array(exports.AvailableCommandSchema),
39
+ available_commands: v4_1.z.array(exports.AvailableCommandSchema),
40
40
  });
41
41
  //# sourceMappingURL=entities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/deviceModel/entities.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,qDAAwD;AACxD,uDAA8D;AAC9D,yDAA0D;AAC1D,2CAAwD;AAE3C,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C;;OAEG;IACH,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,6BAAqB,CAAC;IACjD,aAAa,EAAE,+BAAgB;CAChC,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC;;;OAGG;IACH,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB;;;OAGG;IACH,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB;;;OAGG;IACH,IAAI,EAAE,yBAAc;IACpB;;OAEG;IACH,YAAY,EAAE,6BAAkB;IAChC;;OAEG;IACH,kBAAkB,EAAE,OAAC,CAAC,KAAK,CAAC,8BAAsB,CAAC;CACpD,CAAC,CAAC"}
1
+ {"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/deviceModel/entities.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,qDAAwD;AACxD,uDAA8D;AAC9D,yDAA0D;AAC1D,2CAAwD;AAE3C,QAAA,sBAAsB,GAAG,MAAC,CAAC,MAAM,CAAC;IAC7C;;OAEG;IACH,IAAI,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,6BAAqB,CAAC;IACjD,aAAa,EAAE,+BAAgB;CAChC,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAAG,MAAC,CAAC,MAAM,CAAC;IACxC;;;OAGG;IACH,IAAI,EAAE,MAAC,CAAC,MAAM,EAAE;IAChB;;;OAGG;IACH,IAAI,EAAE,MAAC,CAAC,MAAM,EAAE;IAChB;;;OAGG;IACH,IAAI,EAAE,yBAAc;IACpB;;OAEG;IACH,YAAY,EAAE,6BAAkB;IAChC;;OAEG;IACH,kBAAkB,EAAE,MAAC,CAAC,KAAK,CAAC,8BAAsB,CAAC;CACpD,CAAC,CAAC"}
@@ -1,180 +1,58 @@
1
- import { z } from "zod";
1
+ import { z } from "zod/v4";
2
2
  export declare const CoreBatteryStateSchema: z.ZodObject<{
3
- /**
4
- * Whether the battery is currently charging. The state could be unknown if not provided by the manufacturer.
5
- * @example "charging"
6
- */
7
- chargingState: z.ZodEnum<["charging", "discharging", "idle", "unknown"]>;
8
- /**
9
- * The current charge of the battery in watt-hours (Wh).
10
- * @example 43200
11
- */
3
+ chargingState: z.ZodEnum<{
4
+ unknown: "unknown";
5
+ idle: "idle";
6
+ charging: "charging";
7
+ discharging: "discharging";
8
+ }>;
12
9
  charge: z.ZodNumber;
13
- /**
14
- * The current charge of the battery as a percentage. Represented as a number between 0 and 100.
15
- * @example 50
16
- */
17
10
  chargePercentage: z.ZodNumber;
18
- /**
19
- * The current charge rate of the battery in watts (W).
20
- *
21
- * If negative, the battery is charging (consuming power).
22
- * If positive, the battery is discharging (supplying power).
23
- * If 0 then the battery is idle.
24
- *
25
- * @example 1000
26
- * @optional
27
- */
28
11
  chargeRate: z.ZodOptional<z.ZodNumber>;
29
- /**
30
- * The current charge percentage that should be reserved for backup power. Represented as a number between 0 and 100.
31
- * @example 90
32
- * @optional
33
- */
34
12
  backupReserve: z.ZodOptional<z.ZodNumber>;
35
- /**
36
- * Whether the battery has an active storm mode alert.
37
- * @example true
38
- * @optional
39
- */
40
13
  isStormModeActive: z.ZodOptional<z.ZodBoolean>;
41
- /**
42
- * Whether the battery has an active storm mode enabled.
43
- * @example true
44
- * @optional
45
- */
46
14
  isStormModeEnabled: z.ZodOptional<z.ZodBoolean>;
47
- /**
48
- * The current strategy or mode the battery is operating in.
49
- * @example "self-consumption"
50
- */
51
- strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<["unknown", "self_consumption", "time_of_use", "backup"]>>>;
52
- }, "strip", z.ZodTypeAny, {
53
- chargingState: "unknown" | "idle" | "charging" | "discharging";
54
- charge: number;
55
- chargePercentage: number;
56
- chargeRate?: number | undefined;
57
- backupReserve?: number | undefined;
58
- isStormModeActive?: boolean | undefined;
59
- isStormModeEnabled?: boolean | undefined;
60
- strategy?: "unknown" | "self_consumption" | "time_of_use" | "backup" | undefined;
61
- }, {
62
- chargingState: "unknown" | "idle" | "charging" | "discharging";
63
- charge: number;
64
- chargePercentage: number;
65
- chargeRate?: number | undefined;
66
- backupReserve?: number | undefined;
67
- isStormModeActive?: boolean | undefined;
68
- isStormModeEnabled?: boolean | undefined;
69
- strategy?: "unknown" | "self_consumption" | "time_of_use" | "backup" | undefined;
70
- }>;
15
+ strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
16
+ unknown: "unknown";
17
+ self_consumption: "self_consumption";
18
+ time_of_use: "time_of_use";
19
+ backup: "backup";
20
+ }>>>;
21
+ }, z.core.$strip>;
71
22
  export declare const BatteryStateSchema: z.ZodObject<{
72
- /**
73
- * Whether the battery is currently charging. The state could be unknown if not provided by the manufacturer.
74
- * @example "charging"
75
- */
76
- chargingState: z.ZodEnum<["charging", "discharging", "idle", "unknown"]>;
77
- /**
78
- * The current charge of the battery in watt-hours (Wh).
79
- * @example 43200
80
- */
23
+ chargingState: z.ZodEnum<{
24
+ unknown: "unknown";
25
+ idle: "idle";
26
+ charging: "charging";
27
+ discharging: "discharging";
28
+ }>;
81
29
  charge: z.ZodNumber;
82
- /**
83
- * The current charge of the battery as a percentage. Represented as a number between 0 and 100.
84
- * @example 50
85
- */
86
30
  chargePercentage: z.ZodNumber;
87
- /**
88
- * The current charge rate of the battery in watts (W).
89
- *
90
- * If negative, the battery is charging (consuming power).
91
- * If positive, the battery is discharging (supplying power).
92
- * If 0 then the battery is idle.
93
- *
94
- * @example 1000
95
- * @optional
96
- */
97
31
  chargeRate: z.ZodOptional<z.ZodNumber>;
98
- /**
99
- * The current charge percentage that should be reserved for backup power. Represented as a number between 0 and 100.
100
- * @example 90
101
- * @optional
102
- */
103
32
  backupReserve: z.ZodOptional<z.ZodNumber>;
104
- /**
105
- * Whether the battery has an active storm mode alert.
106
- * @example true
107
- * @optional
108
- */
109
33
  isStormModeActive: z.ZodOptional<z.ZodBoolean>;
110
- /**
111
- * Whether the battery has an active storm mode enabled.
112
- * @example true
113
- * @optional
114
- */
115
34
  isStormModeEnabled: z.ZodOptional<z.ZodBoolean>;
116
- /**
117
- * The current strategy or mode the battery is operating in.
118
- * @example "self-consumption"
119
- */
120
- strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<["unknown", "self_consumption", "time_of_use", "backup"]>>>;
121
- } & {
122
- gridStatus: z.ZodOptional<z.ZodEnum<["exporting", "importing", "idle", "unknown"]>>;
35
+ strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
36
+ unknown: "unknown";
37
+ self_consumption: "self_consumption";
38
+ time_of_use: "time_of_use";
39
+ backup: "backup";
40
+ }>>>;
41
+ gridStatus: z.ZodOptional<z.ZodEnum<{
42
+ unknown: "unknown";
43
+ idle: "idle";
44
+ exporting: "exporting";
45
+ importing: "importing";
46
+ }>>;
123
47
  gridPower: z.ZodOptional<z.ZodNumber>;
124
48
  gridEnergy: z.ZodOptional<z.ZodNumber>;
125
- }, "strip", z.ZodTypeAny, {
126
- chargingState: "unknown" | "idle" | "charging" | "discharging";
127
- charge: number;
128
- chargePercentage: number;
129
- gridStatus?: "unknown" | "idle" | "exporting" | "importing" | undefined;
130
- gridPower?: number | undefined;
131
- gridEnergy?: number | undefined;
132
- chargeRate?: number | undefined;
133
- backupReserve?: number | undefined;
134
- isStormModeActive?: boolean | undefined;
135
- isStormModeEnabled?: boolean | undefined;
136
- strategy?: "unknown" | "self_consumption" | "time_of_use" | "backup" | undefined;
137
- }, {
138
- chargingState: "unknown" | "idle" | "charging" | "discharging";
139
- charge: number;
140
- chargePercentage: number;
141
- gridStatus?: "unknown" | "idle" | "exporting" | "importing" | undefined;
142
- gridPower?: number | undefined;
143
- gridEnergy?: number | undefined;
144
- chargeRate?: number | undefined;
145
- backupReserve?: number | undefined;
146
- isStormModeActive?: boolean | undefined;
147
- isStormModeEnabled?: boolean | undefined;
148
- strategy?: "unknown" | "self_consumption" | "time_of_use" | "backup" | undefined;
149
- }>;
49
+ }, z.core.$strip>;
150
50
  export type BatteryState = z.infer<typeof BatteryStateSchema>;
151
51
  export declare const BatteryStaticStateSchema: z.ZodObject<{
152
- /**
153
- * The rated maximum capacity of the battery in watt-hours (Wh).
154
- */
155
52
  capacity: z.ZodNumber;
156
- /**
157
- * The rated maximum charge rate of the battery in watts (W).
158
- */
159
53
  maxChargeRate: z.ZodOptional<z.ZodNumber>;
160
- /**
161
- * The rated maximum discharge rate of the battery in watts (W).
162
- */
163
54
  maxDischargeRate: z.ZodOptional<z.ZodNumber>;
164
- /**
165
- * The number of batteries in the system.
166
- */
167
55
  numberOfBatteries: z.ZodOptional<z.ZodNumber>;
168
- }, "strip", z.ZodTypeAny, {
169
- capacity: number;
170
- maxChargeRate?: number | undefined;
171
- maxDischargeRate?: number | undefined;
172
- numberOfBatteries?: number | undefined;
173
- }, {
174
- capacity: number;
175
- maxChargeRate?: number | undefined;
176
- maxDischargeRate?: number | undefined;
177
- numberOfBatteries?: number | undefined;
178
- }>;
56
+ }, z.core.$strip>;
179
57
  export type BatteryStaticState = z.infer<typeof BatteryStaticStateSchema>;
180
58
  //# sourceMappingURL=battery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"battery.d.ts","sourceRoot":"","sources":["../../src/deviceState/battery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,sBAAsB;IACjC;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAMH;;;;;;;;;OASG;;IAEH;;;;OAIG;;IASH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,eAAO,MAAM,kBAAkB;IA9D7B;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAMH;;;;;;;;;OASG;;IAEH;;;;OAIG;;IASH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI8E,CAAC;AACpF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,wBAAwB;IACnC;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;EAEH,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"battery.d.ts","sourceRoot":"","sources":["../../src/deviceState/battery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;iBA6DjC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA2D,CAAC;AAC3F,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,wBAAwB;;;;;iBAiBnC,CAAC;AACH,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.BatteryStaticStateSchema = exports.BatteryStateSchema = exports.CoreBatteryStateSchema = void 0;
4
- const zod_1 = require("zod");
4
+ const v4_1 = require("zod/v4");
5
5
  const common_1 = require("./common");
6
- exports.CoreBatteryStateSchema = zod_1.z.object({
6
+ exports.CoreBatteryStateSchema = v4_1.z.object({
7
7
  /**
8
8
  * Whether the battery is currently charging. The state could be unknown if not provided by the manufacturer.
9
9
  * @example "charging"
@@ -13,12 +13,12 @@ exports.CoreBatteryStateSchema = zod_1.z.object({
13
13
  * The current charge of the battery in watt-hours (Wh).
14
14
  * @example 43200
15
15
  */
16
- charge: zod_1.z.number().describe("The current charge of the battery in watt-hours (Wh)."),
16
+ charge: v4_1.z.number().describe("The current charge of the battery in watt-hours (Wh)."),
17
17
  /**
18
18
  * The current charge of the battery as a percentage. Represented as a number between 0 and 100.
19
19
  * @example 50
20
20
  */
21
- chargePercentage: zod_1.z
21
+ chargePercentage: v4_1.z
22
22
  .number()
23
23
  .min(0)
24
24
  .max(100)
@@ -33,13 +33,13 @@ exports.CoreBatteryStateSchema = zod_1.z.object({
33
33
  * @example 1000
34
34
  * @optional
35
35
  */
36
- chargeRate: zod_1.z.number().optional().describe("The current charge rate of the battery in watts (W)."),
36
+ chargeRate: v4_1.z.number().optional().describe("The current charge rate of the battery in watts (W)."),
37
37
  /**
38
38
  * The current charge percentage that should be reserved for backup power. Represented as a number between 0 and 100.
39
39
  * @example 90
40
40
  * @optional
41
41
  */
42
- backupReserve: zod_1.z
42
+ backupReserve: v4_1.z
43
43
  .number()
44
44
  .min(0)
45
45
  .max(100)
@@ -50,36 +50,36 @@ exports.CoreBatteryStateSchema = zod_1.z.object({
50
50
  * @example true
51
51
  * @optional
52
52
  */
53
- isStormModeActive: zod_1.z.boolean().optional().describe("Whether the battery has an active storm mode alert."),
53
+ isStormModeActive: v4_1.z.boolean().optional().describe("Whether the battery has an active storm mode alert."),
54
54
  /**
55
55
  * Whether the battery has an active storm mode enabled.
56
56
  * @example true
57
57
  * @optional
58
58
  */
59
- isStormModeEnabled: zod_1.z.boolean().optional().describe("Whether the battery has storm mode enabled."),
59
+ isStormModeEnabled: v4_1.z.boolean().optional().describe("Whether the battery has storm mode enabled."),
60
60
  /**
61
61
  * The current strategy or mode the battery is operating in.
62
62
  * @example "self-consumption"
63
63
  */
64
64
  strategy: common_1.BatteryStrategiesEnum.optional(),
65
65
  });
66
- exports.BatteryStateSchema = exports.CoreBatteryStateSchema.merge(common_1.CoreGridStateSchema);
67
- exports.BatteryStaticStateSchema = zod_1.z.object({
66
+ exports.BatteryStateSchema = exports.CoreBatteryStateSchema.extend(common_1.CoreGridStateSchema.shape);
67
+ exports.BatteryStaticStateSchema = v4_1.z.object({
68
68
  /**
69
69
  * The rated maximum capacity of the battery in watt-hours (Wh).
70
70
  */
71
- capacity: zod_1.z.number().describe("The rated maximum capacity of the battery in watt-hours (Wh)."),
71
+ capacity: v4_1.z.number().describe("The rated maximum capacity of the battery in watt-hours (Wh)."),
72
72
  /**
73
73
  * The rated maximum charge rate of the battery in watts (W).
74
74
  */
75
- maxChargeRate: zod_1.z.number().optional().describe("The rated maximum charge rate of the battery in watts (W)."),
75
+ maxChargeRate: v4_1.z.number().optional().describe("The rated maximum charge rate of the battery in watts (W)."),
76
76
  /**
77
77
  * The rated maximum discharge rate of the battery in watts (W).
78
78
  */
79
- maxDischargeRate: zod_1.z.number().optional().describe("The rated maximum discharge rate of the battery in watts (W)."),
79
+ maxDischargeRate: v4_1.z.number().optional().describe("The rated maximum discharge rate of the battery in watts (W)."),
80
80
  /**
81
81
  * The number of batteries in the system.
82
82
  */
83
- numberOfBatteries: zod_1.z.number().int().positive().optional().describe("The number of batteries in the system."),
83
+ numberOfBatteries: v4_1.z.number().int().positive().optional().describe("The number of batteries in the system."),
84
84
  });
85
85
  //# sourceMappingURL=battery.js.map