iobroker.zendure-solarflow 1.1.14 → 1.1.16
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/README.md +10 -0
- package/admin/build/index.js +12 -12
- package/admin/build/index.js.map +2 -2
- package/build/helpers/createCalculationStates.js +20 -20
- package/build/helpers/createCalculationStates.js.map +2 -2
- package/build/helpers/createControlStates.js +30 -13
- package/build/helpers/createControlStates.js.map +2 -2
- package/build/helpers/createSolarFlowStates.js +123 -162
- package/build/helpers/createSolarFlowStates.js.map +2 -2
- package/build/helpers/deleteCalculationStates.js +1 -1
- package/build/helpers/deleteCalculationStates.js.map +2 -2
- package/build/main.js +20 -25
- package/build/main.js.map +2 -2
- package/build/services/adapterService.js +46 -1
- package/build/services/adapterService.js.map +2 -2
- package/build/services/calculationService.js +48 -32
- package/build/services/calculationService.js.map +2 -2
- package/build/services/jobSchedule.js +25 -9
- package/build/services/jobSchedule.js.map +2 -2
- package/build/services/mqttService.js +48 -27
- package/build/services/mqttService.js.map +2 -2
- package/build/services/webService.js +6 -4
- package/build/services/webService.js.map +2 -2
- package/io-package.json +27 -27
- package/package.json +2 -1
|
@@ -23,7 +23,7 @@ __export(createCalculationStates_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(createCalculationStates_exports);
|
|
24
24
|
const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
25
25
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
26
|
-
productKey
|
|
26
|
+
`${productKey}.${deviceKey}.calculations.solarInputEnergyTodayWh`,
|
|
27
27
|
{
|
|
28
28
|
type: "state",
|
|
29
29
|
common: {
|
|
@@ -42,7 +42,7 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
42
42
|
}
|
|
43
43
|
));
|
|
44
44
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
45
|
-
productKey
|
|
45
|
+
`${productKey}.${deviceKey}.calculations.solarInputEnergyTodaykWh`,
|
|
46
46
|
{
|
|
47
47
|
type: "state",
|
|
48
48
|
common: {
|
|
@@ -61,12 +61,12 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
61
61
|
}
|
|
62
62
|
));
|
|
63
63
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
64
|
-
productKey
|
|
64
|
+
`${productKey}.${deviceKey}.calculations.outputPackEnergyTodayWh`,
|
|
65
65
|
{
|
|
66
66
|
type: "state",
|
|
67
67
|
common: {
|
|
68
68
|
name: {
|
|
69
|
-
de: "Heutige Ladung
|
|
69
|
+
de: "Heutige Ladung zu Batterie (Wh)",
|
|
70
70
|
en: "Todays charge energy to battery (Wh)"
|
|
71
71
|
},
|
|
72
72
|
type: "number",
|
|
@@ -80,12 +80,12 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
80
80
|
}
|
|
81
81
|
));
|
|
82
82
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
83
|
-
productKey
|
|
83
|
+
`${productKey}.${deviceKey}.calculations.outputPackEnergyTodaykWh`,
|
|
84
84
|
{
|
|
85
85
|
type: "state",
|
|
86
86
|
common: {
|
|
87
87
|
name: {
|
|
88
|
-
de: "Heutige Ladung
|
|
88
|
+
de: "Heutige Ladung zur Batterie (kWh)",
|
|
89
89
|
en: "todays charge energy to battery (kWh)"
|
|
90
90
|
},
|
|
91
91
|
type: "number",
|
|
@@ -99,12 +99,12 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
99
99
|
}
|
|
100
100
|
));
|
|
101
101
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
102
|
-
productKey
|
|
102
|
+
`${productKey}.${deviceKey}.calculations.packInputEnergyTodayWh`,
|
|
103
103
|
{
|
|
104
104
|
type: "state",
|
|
105
105
|
common: {
|
|
106
106
|
name: {
|
|
107
|
-
de: "Heutige Einspeisung aus
|
|
107
|
+
de: "Heutige Einspeisung aus Batterie (Wh)",
|
|
108
108
|
en: "Todays discharge energy from battery (Wh)"
|
|
109
109
|
},
|
|
110
110
|
type: "number",
|
|
@@ -118,12 +118,12 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
118
118
|
}
|
|
119
119
|
));
|
|
120
120
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
121
|
-
productKey
|
|
121
|
+
`${productKey}.${deviceKey}.calculations.packInputEnergyTodaykWh`,
|
|
122
122
|
{
|
|
123
123
|
type: "state",
|
|
124
124
|
common: {
|
|
125
125
|
name: {
|
|
126
|
-
de: "Heutige Einspeisung aus
|
|
126
|
+
de: "Heutige Einspeisung aus Batterie (kWh)",
|
|
127
127
|
en: "Todays discharge energy from battery (kWh)"
|
|
128
128
|
},
|
|
129
129
|
type: "number",
|
|
@@ -137,7 +137,7 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
137
137
|
}
|
|
138
138
|
));
|
|
139
139
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
140
|
-
productKey
|
|
140
|
+
`${productKey}.${deviceKey}.calculations.outputHomeEnergyTodayWh`,
|
|
141
141
|
{
|
|
142
142
|
type: "state",
|
|
143
143
|
common: {
|
|
@@ -156,7 +156,7 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
156
156
|
}
|
|
157
157
|
));
|
|
158
158
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
159
|
-
productKey
|
|
159
|
+
`${productKey}.${deviceKey}.calculations.outputHomeEnergyTodaykWh`,
|
|
160
160
|
{
|
|
161
161
|
type: "state",
|
|
162
162
|
common: {
|
|
@@ -175,7 +175,7 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
175
175
|
}
|
|
176
176
|
));
|
|
177
177
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
178
|
-
productKey
|
|
178
|
+
`${productKey}.${deviceKey}.calculations.remainInputTime`,
|
|
179
179
|
{
|
|
180
180
|
type: "state",
|
|
181
181
|
common: {
|
|
@@ -193,7 +193,7 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
193
193
|
}
|
|
194
194
|
));
|
|
195
195
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
196
|
-
productKey
|
|
196
|
+
`${productKey}.${deviceKey}.calculations.remainOutTime`,
|
|
197
197
|
{
|
|
198
198
|
type: "state",
|
|
199
199
|
common: {
|
|
@@ -211,7 +211,7 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
211
211
|
}
|
|
212
212
|
));
|
|
213
213
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
214
|
-
productKey
|
|
214
|
+
`${productKey}.${deviceKey}.calculations.soc`,
|
|
215
215
|
{
|
|
216
216
|
type: "state",
|
|
217
217
|
common: {
|
|
@@ -219,7 +219,7 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
219
219
|
de: "Ladezustand in %",
|
|
220
220
|
en: "State of Charge %"
|
|
221
221
|
},
|
|
222
|
-
type: "
|
|
222
|
+
type: "number",
|
|
223
223
|
desc: "soc",
|
|
224
224
|
role: "value",
|
|
225
225
|
read: true,
|
|
@@ -230,7 +230,7 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
230
230
|
}
|
|
231
231
|
));
|
|
232
232
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
233
|
-
productKey
|
|
233
|
+
`${productKey}.${deviceKey}.calculations.energyWh`,
|
|
234
234
|
{
|
|
235
235
|
type: "state",
|
|
236
236
|
common: {
|
|
@@ -238,7 +238,7 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
238
238
|
de: "Energie in den Batterien (Wh)",
|
|
239
239
|
en: "Energy in battery (Wh)"
|
|
240
240
|
},
|
|
241
|
-
type: "
|
|
241
|
+
type: "number",
|
|
242
242
|
desc: "energyWh",
|
|
243
243
|
role: "value",
|
|
244
244
|
read: true,
|
|
@@ -249,7 +249,7 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
249
249
|
}
|
|
250
250
|
));
|
|
251
251
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
252
|
-
productKey
|
|
252
|
+
`${productKey}.${deviceKey}.calculations.energyWhMax`,
|
|
253
253
|
{
|
|
254
254
|
type: "state",
|
|
255
255
|
common: {
|
|
@@ -257,7 +257,7 @@ const createCalculationStates = async (adapter, productKey, deviceKey) => {
|
|
|
257
257
|
de: "Max. Energie in allen Batterien (Wh)",
|
|
258
258
|
en: "Max. Energy in battery (Wh)"
|
|
259
259
|
},
|
|
260
|
-
type: "
|
|
260
|
+
type: "number",
|
|
261
261
|
desc: "energyWhMax",
|
|
262
262
|
role: "value",
|
|
263
263
|
read: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,0BAA0B,OACrC,SACA,YACA,cACkB;AAIlB,SAAM,mCAAS;AAAA,IACb,
|
|
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 zu Batterie (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 zur Batterie (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 Batterie (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 Batterie (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: \"number\",\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: \"number\",\r\n desc: \"energyWh\",\r\n role: \"value\",\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 // 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: \"number\",\r\n desc: \"energyWhMax\",\r\n role: \"value\",\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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,0BAA0B,OACrC,SACA,YACA,cACkB;AAIlB,SAAM,mCAAS;AAAA,IACb,GAAG,UAAU,IAAI,SAAS;AAAA,IAC1B;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,GAAG,UAAU,IAAI,SAAS;AAAA,IAC1B;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,GAAG,UAAU,IAAI,SAAS;AAAA,IAC1B;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;AAA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AA,QACP,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,IACX;AAAA;AAIF,SAAM,mCAAS;AAAA,IACb,GAAG,UAAU,IAAI,SAAS;AAAA,IAC1B;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,GAAG,UAAU,IAAI,SAAS;AAAA,IAC1B;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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -22,7 +22,7 @@ __export(createControlStates_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(createControlStates_exports);
|
|
24
24
|
const createControlStates = async (adapter, productKey, deviceKey) => {
|
|
25
|
-
await (adapter == null ? void 0 : adapter.extendObjectAsync(productKey
|
|
25
|
+
await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.control`, {
|
|
26
26
|
type: "channel",
|
|
27
27
|
common: {
|
|
28
28
|
name: {
|
|
@@ -33,7 +33,7 @@ const createControlStates = async (adapter, productKey, deviceKey) => {
|
|
|
33
33
|
native: {}
|
|
34
34
|
}));
|
|
35
35
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
36
|
-
productKey
|
|
36
|
+
`${productKey}.${deviceKey}.control.setOutputLimit`,
|
|
37
37
|
{
|
|
38
38
|
type: "state",
|
|
39
39
|
common: {
|
|
@@ -53,7 +53,7 @@ const createControlStates = async (adapter, productKey, deviceKey) => {
|
|
|
53
53
|
}
|
|
54
54
|
));
|
|
55
55
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
56
|
-
productKey
|
|
56
|
+
`${productKey}.${deviceKey}.control.chargeLimit`,
|
|
57
57
|
{
|
|
58
58
|
type: "state",
|
|
59
59
|
common: {
|
|
@@ -74,7 +74,7 @@ const createControlStates = async (adapter, productKey, deviceKey) => {
|
|
|
74
74
|
}
|
|
75
75
|
));
|
|
76
76
|
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
77
|
-
productKey
|
|
77
|
+
`${productKey}.${deviceKey}.control.dischargeLimit`,
|
|
78
78
|
{
|
|
79
79
|
type: "state",
|
|
80
80
|
common: {
|
|
@@ -94,15 +94,32 @@ const createControlStates = async (adapter, productKey, deviceKey) => {
|
|
|
94
94
|
native: {}
|
|
95
95
|
}
|
|
96
96
|
));
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
97
|
+
if (adapter.config.useLowVoltageBlock) {
|
|
98
|
+
await (adapter == null ? void 0 : adapter.extendObjectAsync(
|
|
99
|
+
`${productKey}.${deviceKey}.control.lowVoltageBlock`,
|
|
100
|
+
{
|
|
101
|
+
type: "state",
|
|
102
|
+
common: {
|
|
103
|
+
name: {
|
|
104
|
+
de: "Niedrige Batteriespannung erkannt",
|
|
105
|
+
en: "Low Voltage on battery detected"
|
|
106
|
+
},
|
|
107
|
+
type: "boolean",
|
|
108
|
+
desc: "lowVoltageBlock",
|
|
109
|
+
role: "value.switch",
|
|
110
|
+
read: true,
|
|
111
|
+
write: false
|
|
112
|
+
},
|
|
113
|
+
native: {}
|
|
114
|
+
}
|
|
115
|
+
));
|
|
116
|
+
adapter == null ? void 0 : adapter.subscribeStates(
|
|
117
|
+
`${productKey}.${deviceKey}.control.lowVoltageBlock`
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
adapter == null ? void 0 : adapter.subscribeStates(`${productKey}.${deviceKey}.control.setOutputLimit`);
|
|
121
|
+
adapter == null ? void 0 : adapter.subscribeStates(`${productKey}.${deviceKey}.control.chargeLimit`);
|
|
122
|
+
adapter == null ? void 0 : adapter.subscribeStates(`${productKey}.${deviceKey}.control.dischargeLimit`);
|
|
106
123
|
};
|
|
107
124
|
// Annotate the CommonJS export names for ESM import in node:
|
|
108
125
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,sBAAsB,OACjC,SACA,YACA,cACkB;AAElB,SAAM,mCAAS,kBAAkB,
|
|
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 if (adapter.config.useLowVoltageBlock) {\r\n // State zum Setzen des Output Limit\r\n await adapter?.extendObjectAsync(\r\n `${productKey}.${deviceKey}.control.lowVoltageBlock`,\r\n {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: \"Niedrige Batteriespannung erkannt\",\r\n en: \"Low Voltage on battery detected\",\r\n },\r\n type: \"boolean\",\r\n desc: \"lowVoltageBlock\",\r\n role: \"value.switch\",\r\n read: true,\r\n write: false,\r\n },\r\n native: {},\r\n },\r\n );\r\n\r\n adapter?.subscribeStates(\r\n `${productKey}.${deviceKey}.control.lowVoltageBlock`,\r\n );\r\n }\r\n\r\n // Subcribe to control states\r\n adapter?.subscribeStates(`${productKey}.${deviceKey}.control.setOutputLimit`);\r\n\r\n adapter?.subscribeStates(`${productKey}.${deviceKey}.control.chargeLimit`);\r\n\r\n adapter?.subscribeStates(`${productKey}.${deviceKey}.control.dischargeLimit`);\r\n};\r\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,sBAAsB,OACjC,SACA,YACA,cACkB;AAElB,SAAM,mCAAS,kBAAkB,GAAG,UAAU,IAAI,SAAS,YAAY;AAAA,IACrE,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,MAAM;AAAA,QACJ,IAAI,+BAAyB;AAAA,QAC7B,IAAI,wBAAwB;AAAA,MAC9B;AAAA,IACF;AAAA,IACA,QAAQ,CAAC;AAAA,EACX;AAGA,SAAM,mCAAS;AAAA,IACb,GAAG,UAAU,IAAI,SAAS;AAAA,IAC1B;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,KAAK;AAAA,QACL,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,IACX;AAAA;AAIF,SAAM,mCAAS;AAAA,IACb,GAAG,UAAU,IAAI,SAAS;AAAA,IAC1B;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,KAAK;AAAA,QACL,KAAK;AAAA,QACL,M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