iobroker.zendure-solarflow 1.1.9 → 1.1.12

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.
@@ -0,0 +1,275 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var createCalculationStates_exports = {};
20
+ __export(createCalculationStates_exports, {
21
+ createCalculationStates: () => createCalculationStates
22
+ });
23
+ module.exports = __toCommonJS(createCalculationStates_exports);
24
+ const createCalculationStates = async (adapter, productKey, deviceKey) => {
25
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
26
+ productKey + "." + deviceKey + ".calculations.solarInputEnergyTodayWh",
27
+ {
28
+ type: "state",
29
+ common: {
30
+ name: {
31
+ de: "Heutiger Solarertrag (Wh)",
32
+ en: "Todays solar input (Wh)"
33
+ },
34
+ type: "number",
35
+ desc: "solarInputEnergyTodayWh",
36
+ role: "value.energy",
37
+ read: true,
38
+ write: false,
39
+ unit: "Wh"
40
+ },
41
+ native: {}
42
+ }
43
+ ));
44
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
45
+ productKey + "." + deviceKey + ".calculations.solarInputEnergyTodaykWh",
46
+ {
47
+ type: "state",
48
+ common: {
49
+ name: {
50
+ de: "Heutiger Solarertrag (kWh)",
51
+ en: "Todays solar input (kWh)"
52
+ },
53
+ type: "number",
54
+ desc: "solarInputEnergyTodaykWh",
55
+ role: "value.energy",
56
+ read: true,
57
+ write: false,
58
+ unit: "kWh"
59
+ },
60
+ native: {}
61
+ }
62
+ ));
63
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
64
+ productKey + "." + deviceKey + ".calculations.outputPackEnergyTodayWh",
65
+ {
66
+ type: "state",
67
+ common: {
68
+ name: {
69
+ de: "Heutige Ladung zum Akku (Wh)",
70
+ en: "Todays charge energy to battery (Wh)"
71
+ },
72
+ type: "number",
73
+ desc: "outputPackEnergyTodayWh",
74
+ role: "value.energy",
75
+ read: true,
76
+ write: false,
77
+ unit: "Wh"
78
+ },
79
+ native: {}
80
+ }
81
+ ));
82
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
83
+ productKey + "." + deviceKey + ".calculations.outputPackEnergyTodaykWh",
84
+ {
85
+ type: "state",
86
+ common: {
87
+ name: {
88
+ de: "Heutige Ladung zum Akku (kWh)",
89
+ en: "todays charge energy to battery (kWh)"
90
+ },
91
+ type: "number",
92
+ desc: "outputPackEnergyTodaykWh",
93
+ role: "value.energy",
94
+ read: true,
95
+ write: false,
96
+ unit: "kWh"
97
+ },
98
+ native: {}
99
+ }
100
+ ));
101
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
102
+ productKey + "." + deviceKey + ".calculations.packInputEnergyTodayWh",
103
+ {
104
+ type: "state",
105
+ common: {
106
+ name: {
107
+ de: "Heutige Einspeisung aus Akku (Wh)",
108
+ en: "Todays discharge energy from battery (Wh)"
109
+ },
110
+ type: "number",
111
+ desc: "packInputEnergyTodayWh",
112
+ role: "value.energy",
113
+ read: true,
114
+ write: false,
115
+ unit: "Wh"
116
+ },
117
+ native: {}
118
+ }
119
+ ));
120
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
121
+ productKey + "." + deviceKey + ".calculations.packInputEnergyTodaykWh",
122
+ {
123
+ type: "state",
124
+ common: {
125
+ name: {
126
+ de: "Heutige Einspeisung aus Akku (kWh)",
127
+ en: "Todays discharge energy from battery (kWh)"
128
+ },
129
+ type: "number",
130
+ desc: "packInputEnergyTodaykWh",
131
+ role: "value.energy",
132
+ read: true,
133
+ write: false,
134
+ unit: "kWh"
135
+ },
136
+ native: {}
137
+ }
138
+ ));
139
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
140
+ productKey + "." + deviceKey + ".calculations.outputHomeEnergyTodayWh",
141
+ {
142
+ type: "state",
143
+ common: {
144
+ name: {
145
+ de: "Heutige Einspeisung ins Haus (Wh)",
146
+ en: "Todays input energy to home (Wh)"
147
+ },
148
+ type: "number",
149
+ desc: "outputHomeEnergyTodayWh",
150
+ role: "value.energy",
151
+ read: true,
152
+ write: false,
153
+ unit: "Wh"
154
+ },
155
+ native: {}
156
+ }
157
+ ));
158
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
159
+ productKey + "." + deviceKey + ".calculations.outputHomeEnergyTodaykWh",
160
+ {
161
+ type: "state",
162
+ common: {
163
+ name: {
164
+ de: "Heutige Einspeisung ins Haus (kWh)",
165
+ en: "Todays input energy to home (kWh)"
166
+ },
167
+ type: "number",
168
+ desc: "outputHomeEnergyTodaykWh",
169
+ role: "value.energy",
170
+ read: true,
171
+ write: false,
172
+ unit: "kWh"
173
+ },
174
+ native: {}
175
+ }
176
+ ));
177
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
178
+ productKey + "." + deviceKey + ".calculations.remainInputTime",
179
+ {
180
+ type: "state",
181
+ common: {
182
+ name: {
183
+ de: "Erwartete Ladedauer (hh:mm)",
184
+ en: "remaining charge time (hh:mm)"
185
+ },
186
+ type: "string",
187
+ desc: "calcRemainInputTime",
188
+ role: "value",
189
+ read: true,
190
+ write: false
191
+ },
192
+ native: {}
193
+ }
194
+ ));
195
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
196
+ productKey + "." + deviceKey + ".calculations.remainOutTime",
197
+ {
198
+ type: "state",
199
+ common: {
200
+ name: {
201
+ de: "Erwartete Entladedauer (hh:mm)",
202
+ en: "remaining discharge time (hh:mm)"
203
+ },
204
+ type: "string",
205
+ desc: "calcRemainOutTime",
206
+ role: "value",
207
+ read: true,
208
+ write: false
209
+ },
210
+ native: {}
211
+ }
212
+ ));
213
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
214
+ productKey + "." + deviceKey + ".calculations.soc",
215
+ {
216
+ type: "state",
217
+ common: {
218
+ name: {
219
+ de: "Ladezustand in %",
220
+ en: "State of Charge %"
221
+ },
222
+ type: "string",
223
+ desc: "soc",
224
+ role: "value",
225
+ read: true,
226
+ write: false,
227
+ unit: "%"
228
+ },
229
+ native: {}
230
+ }
231
+ ));
232
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
233
+ productKey + "." + deviceKey + ".calculations.energyWh",
234
+ {
235
+ type: "state",
236
+ common: {
237
+ name: {
238
+ de: "Energie in den Batterien (Wh)",
239
+ en: "Energy in battery (Wh)"
240
+ },
241
+ type: "string",
242
+ desc: "energyWh",
243
+ role: "value",
244
+ read: true,
245
+ write: false,
246
+ unit: "%"
247
+ },
248
+ native: {}
249
+ }
250
+ ));
251
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
252
+ productKey + "." + deviceKey + ".calculations.energyWhMax",
253
+ {
254
+ type: "state",
255
+ common: {
256
+ name: {
257
+ de: "Max. Energie in allen Batterien (Wh)",
258
+ en: "Max. Energy in battery (Wh)"
259
+ },
260
+ type: "string",
261
+ desc: "energyWhMax",
262
+ role: "value",
263
+ read: true,
264
+ write: false,
265
+ unit: "%"
266
+ },
267
+ native: {}
268
+ }
269
+ ));
270
+ };
271
+ // Annotate the CommonJS export names for ESM import in node:
272
+ 0 && (module.exports = {
273
+ createCalculationStates
274
+ });
275
+ //# sourceMappingURL=createCalculationStates.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/helpers/createCalculationStates.ts"],
4
+ "sourcesContent": ["import { ZendureSolarflow } from \"../main\";\r\n\r\n/* eslint-disable @typescript-eslint/indent */\r\nexport const createCalculationStates = async (\r\n adapter: ZendureSolarflow,\r\n productKey: string,\r\n deviceKey: string,\r\n): Promise<void> => {\r\n /*\r\n Start Solar Input Energy states\r\n */\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.solarInputEnergyTodayWh\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Heutiger Solarertrag (Wh)\",\r\n en: \"Todays solar input (Wh)\",\r\n },\r\n type: \"number\",\r\n desc: \"solarInputEnergyTodayWh\",\r\n role: \"value.energy\",\r\n read: true,\r\n write: false,\r\n unit: \"Wh\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.solarInputEnergyTodaykWh\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Heutiger Solarertrag (kWh)\",\r\n en: \"Todays solar input (kWh)\",\r\n },\r\n type: \"number\",\r\n desc: \"solarInputEnergyTodaykWh\",\r\n role: \"value.energy\",\r\n read: true,\r\n write: false,\r\n unit: \"kWh\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n /*\r\n Start output pack Energy states\r\n */\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.outputPackEnergyTodayWh\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Heutige Ladung zum Akku (Wh)\",\r\n en: \"Todays charge energy to battery (Wh)\",\r\n },\r\n type: \"number\",\r\n desc: \"outputPackEnergyTodayWh\",\r\n role: \"value.energy\",\r\n read: true,\r\n write: false,\r\n unit: \"Wh\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.outputPackEnergyTodaykWh\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Heutige Ladung zum Akku (kWh)\",\r\n en: \"todays charge energy to battery (kWh)\",\r\n },\r\n type: \"number\",\r\n desc: \"outputPackEnergyTodaykWh\",\r\n role: \"value.energy\",\r\n read: true,\r\n write: false,\r\n unit: \"kWh\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n /*\r\n Start Pack Input Energy states\r\n */\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.packInputEnergyTodayWh\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Heutige Einspeisung aus Akku (Wh)\",\r\n en: \"Todays discharge energy from battery (Wh)\",\r\n },\r\n type: \"number\",\r\n desc: \"packInputEnergyTodayWh\",\r\n role: \"value.energy\",\r\n read: true,\r\n write: false,\r\n unit: \"Wh\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.packInputEnergyTodaykWh\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Heutige Einspeisung aus Akku (kWh)\",\r\n en: \"Todays discharge energy from battery (kWh)\",\r\n },\r\n type: \"number\",\r\n desc: \"packInputEnergyTodaykWh\",\r\n role: \"value.energy\",\r\n read: true,\r\n write: false,\r\n unit: \"kWh\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n /*\r\n Start outputHome Energy states\r\n */\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.outputHomeEnergyTodayWh\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Heutige Einspeisung ins Haus (Wh)\",\r\n en: \"Todays input energy to home (Wh)\",\r\n },\r\n type: \"number\",\r\n desc: \"outputHomeEnergyTodayWh\",\r\n role: \"value.energy\",\r\n read: true,\r\n write: false,\r\n unit: \"Wh\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.outputHomeEnergyTodaykWh\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Heutige Einspeisung ins Haus (kWh)\",\r\n en: \"Todays input energy to home (kWh)\",\r\n },\r\n type: \"number\",\r\n desc: \"outputHomeEnergyTodaykWh\",\r\n role: \"value.energy\",\r\n read: true,\r\n write: false,\r\n unit: \"kWh\",\r\n },\r\n native: {},\r\n },\r\n );\r\n /*\r\n End Energy states\r\n */\r\n\r\n // Calculation input time\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.remainInputTime\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Erwartete Ladedauer (hh:mm)\",\r\n en: \"remaining charge time (hh:mm)\",\r\n },\r\n type: \"string\",\r\n desc: \"calcRemainInputTime\",\r\n role: \"value\",\r\n read: true,\r\n write: false,\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n // Calculation remainOutTime\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.remainOutTime\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Erwartete Entladedauer (hh:mm)\",\r\n en: \"remaining discharge time (hh:mm)\",\r\n },\r\n type: \"string\",\r\n desc: \"calcRemainOutTime\",\r\n role: \"value\",\r\n read: true,\r\n write: false,\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n // Calculation SOC\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.soc\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Ladezustand in %\",\r\n en: \"State of Charge %\",\r\n },\r\n type: \"string\",\r\n desc: \"soc\",\r\n role: \"value\",\r\n read: true,\r\n write: false,\r\n unit: \"%\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n // Energy Wh\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.energyWh\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Energie in den Batterien (Wh)\",\r\n en: \"Energy in battery (Wh)\",\r\n },\r\n type: \"string\",\r\n desc: \"energyWh\",\r\n role: \"value\",\r\n read: true,\r\n write: false,\r\n unit: \"%\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n // Max. Energy for alle batteries Wh\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".calculations.energyWhMax\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Max. Energie in allen Batterien (Wh)\",\r\n en: \"Max. Energy in battery (Wh)\",\r\n },\r\n type: \"string\",\r\n desc: \"energyWhMax\",\r\n role: \"value\",\r\n read: true,\r\n write: false,\r\n unit: \"%\",\r\n },\r\n native: {},\r\n },\r\n );\r\n};\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,0BAA0B,OACrC,SACA,YACA,cACkB;AAIlB,SAAM,mCAAS;AAAA,IACb,aAAa,MAAM,YAAY;AAAA,IAC/B;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,QACN,MAAM;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,IACX;AAAA;AAGF,SAAM,mCAAS;AAAA,IACb,aAAa,MAAM,YAAY;AAAA,IAC/B;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,QACN,MAAM;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,IACX;AAAA;AAMF,SAAM,mCAAS;AAAA,IACb,aAAa,M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Aa,MAAM,YAAY;AAAA,IAC/B;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,QACN,MAAM;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,IACX;AAAA;AAIF,SAAM,mCAAS;AAAA,IACb,aAAa,MAAM,YAAY;AAAA,IAC/B;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,QACN,MAAM;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,IACX;AAAA;AAIF,SAAM,mCAAS;AAAA,IACb,aAAa,MAAM,YAAY;AAAA,IAC/B;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,QACN,MAAM;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,IACX;AAAA;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var createControlStates_exports = {};
20
+ __export(createControlStates_exports, {
21
+ createControlStates: () => createControlStates
22
+ });
23
+ module.exports = __toCommonJS(createControlStates_exports);
24
+ const createControlStates = async (adapter, productKey, deviceKey) => {
25
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(productKey + "." + deviceKey + ".control", {
26
+ type: "channel",
27
+ common: {
28
+ name: {
29
+ de: "Steuerung f\xFCr Ger\xE4t " + deviceKey,
30
+ en: "Control for device " + deviceKey
31
+ }
32
+ },
33
+ native: {}
34
+ }));
35
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
36
+ productKey + "." + deviceKey + ".control.setOutputLimit",
37
+ {
38
+ type: "state",
39
+ common: {
40
+ name: {
41
+ de: "Einzustellende Ausgangsleistung",
42
+ en: "Control of the output limit"
43
+ },
44
+ type: "number",
45
+ desc: "setOutputLimit",
46
+ role: "value.power",
47
+ read: true,
48
+ write: true,
49
+ min: 0,
50
+ unit: "W"
51
+ },
52
+ native: {}
53
+ }
54
+ ));
55
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
56
+ productKey + "." + deviceKey + ".control.chargeLimit",
57
+ {
58
+ type: "state",
59
+ common: {
60
+ name: {
61
+ de: "Setzen des Lade-Limits",
62
+ en: "Control of the charge limit"
63
+ },
64
+ type: "number",
65
+ desc: "chargeLimit",
66
+ role: "value.battery",
67
+ read: true,
68
+ write: true,
69
+ min: 40,
70
+ max: 100,
71
+ unit: "%"
72
+ },
73
+ native: {}
74
+ }
75
+ ));
76
+ await (adapter == null ? void 0 : adapter.extendObjectAsync(
77
+ productKey + "." + deviceKey + ".control.dischargeLimit",
78
+ {
79
+ type: "state",
80
+ common: {
81
+ name: {
82
+ de: "Setzen des Entlade-Limits",
83
+ en: "Control of the discharge limit"
84
+ },
85
+ type: "number",
86
+ desc: "dischargeLimit",
87
+ role: "value.battery",
88
+ read: true,
89
+ write: true,
90
+ min: 0,
91
+ max: 90,
92
+ unit: "%"
93
+ },
94
+ native: {}
95
+ }
96
+ ));
97
+ adapter == null ? void 0 : adapter.subscribeStates(
98
+ productKey + "." + deviceKey + ".control.setOutputLimit"
99
+ );
100
+ adapter == null ? void 0 : adapter.subscribeStates(
101
+ productKey + "." + deviceKey + ".control.chargeLimit"
102
+ );
103
+ adapter == null ? void 0 : adapter.subscribeStates(
104
+ productKey + "." + deviceKey + ".control.dischargeLimit"
105
+ );
106
+ };
107
+ // Annotate the CommonJS export names for ESM import in node:
108
+ 0 && (module.exports = {
109
+ createControlStates
110
+ });
111
+ //# sourceMappingURL=createControlStates.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/helpers/createControlStates.ts"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/indent */\r\n\r\nimport { ZendureSolarflow } from \"../main\";\r\n\r\nexport const createControlStates = async (\r\n adapter: ZendureSolarflow,\r\n productKey: string,\r\n deviceKey: string,\r\n): Promise<void> => {\r\n // Create control folder\r\n await adapter?.extendObjectAsync(productKey + \".\" + deviceKey + \".control\", {\r\n type: \"channel\",\r\n common: {\r\n name: {\r\n de: \"Steuerung f\u00FCr Ger\u00E4t \" + deviceKey,\r\n en: \"Control for device \" + deviceKey,\r\n },\r\n },\r\n native: {},\r\n });\r\n\r\n // State zum Setzen des Output Limit\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".control.\" + \"setOutputLimit\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Einzustellende Ausgangsleistung\",\r\n en: \"Control of the output limit\",\r\n },\r\n type: \"number\",\r\n desc: \"setOutputLimit\",\r\n role: \"value.power\",\r\n read: true,\r\n write: true,\r\n min: 0,\r\n unit: \"W\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n // State zum Setzen des Charge Limit\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".control.\" + \"chargeLimit\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Setzen des Lade-Limits\",\r\n en: \"Control of the charge limit\",\r\n },\r\n type: \"number\",\r\n desc: \"chargeLimit\",\r\n role: \"value.battery\",\r\n read: true,\r\n write: true,\r\n min: 40,\r\n max: 100,\r\n unit: \"%\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n // State zum Setzen des Discharge Limit\r\n await adapter?.extendObjectAsync(\r\n productKey + \".\" + deviceKey + \".control.\" + \"dischargeLimit\",\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Setzen des Entlade-Limits\",\r\n en: \"Control of the discharge limit\",\r\n },\r\n type: \"number\",\r\n desc: \"dischargeLimit\",\r\n role: \"value.battery\",\r\n read: true,\r\n write: true,\r\n min: 0,\r\n max: 90,\r\n unit: \"%\",\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n // Subcribe to control states\r\n adapter?.subscribeStates(\r\n productKey + \".\" + deviceKey + \".control.\" + \"setOutputLimit\",\r\n );\r\n\r\n adapter?.subscribeStates(\r\n productKey + \".\" + deviceKey + \".control.\" + \"chargeLimit\",\r\n );\r\n\r\n adapter?.subscribeStates(\r\n productKey + \".\" + deviceKey + \".control.\" + \"dischargeLimit\",\r\n );\r\n};\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,sBAAsB,OACjC,SACA,YACA,cACkB;AAElB,SAAM,mCAAS,kBAAkB,aAAa,MAAM,YAAY,YAAY;AAAA,IAC1E,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,MAAM;AAAA,QACJ,IAAI,+BAAyB;AAAA,QAC7B,IAAI,wBAAwB;AAAA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