iobroker.zendure-solarflow 2.0.2 → 2.0.4
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
CHANGED
|
@@ -63,9 +63,14 @@ You will be logged out of the official iOS or Android App after logging in with
|
|
|
63
63
|
Credits goes to https://github.com/reinhard-brandstaedter/solarflow which helped a lot with the knowledge about the MQTT server from Zendure! Thanks!
|
|
64
64
|
|
|
65
65
|
## Changelog
|
|
66
|
-
### 2.0.
|
|
66
|
+
### 2.0.4 (2025-09-12)
|
|
67
67
|
|
|
68
|
-
-
|
|
68
|
+
- Fix creation of control states on new Hyper 2000 v3
|
|
69
|
+
- Updates dependencies
|
|
70
|
+
|
|
71
|
+
### 2.0.3 (2025-09-09)
|
|
72
|
+
|
|
73
|
+
- Added 'B3Dxda' as new Hyper 2000 productKey
|
|
69
74
|
- Removed parameter 'upTime' and 'pullTime' from 'setDeviceAutomationInOutLimit'
|
|
70
75
|
- TEST: Use 'setDeviceAutomationInOutLimit' to let HUB1200/HUB2000 charge with connected ACE 1500
|
|
71
76
|
|
|
@@ -32,6 +32,7 @@ var import_solarflow800States = require("../constants/solarflow800States");
|
|
|
32
32
|
var import_adapterService = require("../services/adapterService");
|
|
33
33
|
var import_createCalculationStates = require("./createCalculationStates");
|
|
34
34
|
var import_createControlStates = require("./createControlStates");
|
|
35
|
+
var import_helpers = require("./helpers");
|
|
35
36
|
const getStateDefinition = (productName) => {
|
|
36
37
|
switch (productName.toLocaleLowerCase()) {
|
|
37
38
|
case "hyper 2000":
|
|
@@ -57,6 +58,7 @@ const getStateDefinition = (productName) => {
|
|
|
57
58
|
const createSolarFlowStates = async (adapter, device) => {
|
|
58
59
|
const productKey = device.productKey.replace(adapter.FORBIDDEN_CHARS, "");
|
|
59
60
|
const deviceKey = device.deviceKey.replace(adapter.FORBIDDEN_CHARS, "");
|
|
61
|
+
const productName = (0, import_helpers.getProductNameFromProductKey)(productKey);
|
|
60
62
|
if (device.productKey == "s3Xk4x") {
|
|
61
63
|
adapter.log.debug(`[createSolarFlowStates] Smart Plug not supported.`);
|
|
62
64
|
return;
|
|
@@ -96,10 +98,10 @@ const createSolarFlowStates = async (adapter, device) => {
|
|
|
96
98
|
native: {}
|
|
97
99
|
}));
|
|
98
100
|
}
|
|
99
|
-
const states = getStateDefinition(
|
|
101
|
+
const states = getStateDefinition(productName);
|
|
100
102
|
if (states.length == 0) {
|
|
101
103
|
adapter.log.error(
|
|
102
|
-
`[createSolarFlowLocalStates] Unknown product (${device.productName}). We cannot create control states! Please contact the developer!`
|
|
104
|
+
`[createSolarFlowLocalStates] Unknown product (${device.productKey}/'${device.productName}'). We cannot create control states! Please contact the developer!`
|
|
103
105
|
);
|
|
104
106
|
return;
|
|
105
107
|
}
|
|
@@ -165,12 +167,7 @@ const createSolarFlowStates = async (adapter, device) => {
|
|
|
165
167
|
);
|
|
166
168
|
if (!device.productName.toLocaleLowerCase().includes("smart plug")) {
|
|
167
169
|
if (!adapter.config.useFallbackService) {
|
|
168
|
-
await (0, import_createControlStates.createControlStates)(
|
|
169
|
-
adapter,
|
|
170
|
-
productKey,
|
|
171
|
-
deviceKey,
|
|
172
|
-
device.productName
|
|
173
|
-
);
|
|
170
|
+
await (0, import_createControlStates.createControlStates)(adapter, productKey, deviceKey, productName);
|
|
174
171
|
}
|
|
175
172
|
if (adapter.config.useCalculation) {
|
|
176
173
|
await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.calculations`, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/helpers/createSolarFlowStates.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/indent */\r\n\r\nimport { ac2400States } from \"../constants/ac2400States\";\r\nimport { aceStates } from \"../constants/aceStates\";\r\nimport { aioStates } from \"../constants/aioStates\";\r\nimport { hubStates } from \"../constants/hubStates\";\r\nimport { hyperStates } from \"../constants/hyperStates\";\r\nimport { solarflow800ProStates } from \"../constants/solarflow800ProStates\";\r\nimport { solarflow800States } from \"../constants/solarflow800States\";\r\nimport { ZendureSolarflow } from \"../main\";\r\nimport { ISolarFlowDeviceDetails } from \"../models/ISolarFlowDeviceDetails\";\r\nimport { ISolarflowState } from \"../models/ISolarflowState\";\r\nimport { updateSolarFlowState } from \"../services/adapterService\";\r\nimport { createCalculationStates } from \"./createCalculationStates\";\r\nimport { createControlStates } from \"./createControlStates\";\r\n//import { deleteCalculationStates } from \"./deleteCalculationStates\";\r\n\r\nexport const getStateDefinition = (productName: string): ISolarflowState[] => {\r\n switch (productName.toLocaleLowerCase()) {\r\n case \"hyper 2000\":\r\n return hyperStates;\r\n case \"solarflow 800\":\r\n return solarflow800States;\r\n case \"solarflow2.0\":\r\n return hubStates;\r\n case \"solarflow hub 2000\":\r\n return hubStates;\r\n case \"solarflow aio zy\":\r\n return aioStates;\r\n case \"ace 1500\":\r\n return aceStates;\r\n case \"solarflow 800 pro\":\r\n return solarflow800ProStates;\r\n case \"solarflow 2400 ac\":\r\n return ac2400States;\r\n default:\r\n return [];\r\n }\r\n};\r\n\r\nexport const createSolarFlowStates = async (\r\n adapter: ZendureSolarflow,\r\n device: ISolarFlowDeviceDetails\r\n): Promise<void> => {\r\n const productKey = device.productKey.replace(adapter.FORBIDDEN_CHARS, \"\");\r\n const deviceKey = device.deviceKey.replace(adapter.FORBIDDEN_CHARS, \"\");\r\n\r\n if (\r\n device.productKey ==\r\n \"s3Xk4x\" /* && adapter && adapter.userId && device.id */\r\n ) {\r\n adapter.log.debug(`[createSolarFlowStates] Smart Plug not supported.`);\r\n return;\r\n // productKey = adapter.userId;\r\n // deviceKey = device.id.toString();\r\n }\r\n\r\n adapter.log.debug(\r\n `[createSolarFlowStates] Creating or updating SolarFlow states for ${device.productName} (${productKey}/${deviceKey}) and name '${device.name}'.`\r\n );\r\n\r\n // Create device (e.g. the product type -> SolarFlow)\r\n await adapter?.extendObject(productKey, {\r\n type: \"device\",\r\n common: {\r\n name: {\r\n de: `${device.productName} (${productKey})`,\r\n en: `${device.productName} (${productKey})`,\r\n },\r\n },\r\n native: {},\r\n });\r\n\r\n // Create channel (e.g. the device specific key)\r\n await adapter?.extendObject(productKey + \".\" + deviceKey, {\r\n type: \"channel\",\r\n common: {\r\n name: {\r\n de: `${device.name} (${deviceKey})`,\r\n en: `${device.name} (${deviceKey})`,\r\n },\r\n },\r\n native: {},\r\n });\r\n\r\n // Create pack data folder\r\n if (!device.productName.toLocaleLowerCase().includes(\"smart plug\")) {\r\n await adapter?.extendObject(`${productKey}.${deviceKey}.packData`, {\r\n type: \"channel\",\r\n common: {\r\n name: {\r\n de: \"Batterie Packs\",\r\n en: \"Battery packs\",\r\n },\r\n },\r\n native: {},\r\n });\r\n }\r\n\r\n const states = getStateDefinition(
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAA6B;AAC7B,uBAA0B;AAC1B,uBAA0B;AAC1B,uBAA0B;AAC1B,yBAA4B;AAC5B,mCAAsC;AACtC,gCAAmC;AAInC,4BAAqC;AACrC,qCAAwC;AACxC,iCAAoC;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/indent */\r\n\r\nimport { ac2400States } from \"../constants/ac2400States\";\r\nimport { aceStates } from \"../constants/aceStates\";\r\nimport { aioStates } from \"../constants/aioStates\";\r\nimport { hubStates } from \"../constants/hubStates\";\r\nimport { hyperStates } from \"../constants/hyperStates\";\r\nimport { solarflow800ProStates } from \"../constants/solarflow800ProStates\";\r\nimport { solarflow800States } from \"../constants/solarflow800States\";\r\nimport { ZendureSolarflow } from \"../main\";\r\nimport { ISolarFlowDeviceDetails } from \"../models/ISolarFlowDeviceDetails\";\r\nimport { ISolarflowState } from \"../models/ISolarflowState\";\r\nimport { updateSolarFlowState } from \"../services/adapterService\";\r\nimport { createCalculationStates } from \"./createCalculationStates\";\r\nimport { createControlStates } from \"./createControlStates\";\r\nimport { getProductNameFromProductKey } from \"./helpers\";\r\n//import { deleteCalculationStates } from \"./deleteCalculationStates\";\r\n\r\nexport const getStateDefinition = (productName: string): ISolarflowState[] => {\r\n switch (productName.toLocaleLowerCase()) {\r\n case \"hyper 2000\":\r\n return hyperStates;\r\n case \"solarflow 800\":\r\n return solarflow800States;\r\n case \"solarflow2.0\":\r\n return hubStates;\r\n case \"solarflow hub 2000\":\r\n return hubStates;\r\n case \"solarflow aio zy\":\r\n return aioStates;\r\n case \"ace 1500\":\r\n return aceStates;\r\n case \"solarflow 800 pro\":\r\n return solarflow800ProStates;\r\n case \"solarflow 2400 ac\":\r\n return ac2400States;\r\n default:\r\n return [];\r\n }\r\n};\r\n\r\nexport const createSolarFlowStates = async (\r\n adapter: ZendureSolarflow,\r\n device: ISolarFlowDeviceDetails\r\n): Promise<void> => {\r\n const productKey = device.productKey.replace(adapter.FORBIDDEN_CHARS, \"\");\r\n const deviceKey = device.deviceKey.replace(adapter.FORBIDDEN_CHARS, \"\");\r\n const productName = getProductNameFromProductKey(productKey);\r\n\r\n if (\r\n device.productKey ==\r\n \"s3Xk4x\" /* && adapter && adapter.userId && device.id */\r\n ) {\r\n adapter.log.debug(`[createSolarFlowStates] Smart Plug not supported.`);\r\n return;\r\n // productKey = adapter.userId;\r\n // deviceKey = device.id.toString();\r\n }\r\n\r\n adapter.log.debug(\r\n `[createSolarFlowStates] Creating or updating SolarFlow states for ${device.productName} (${productKey}/${deviceKey}) and name '${device.name}'.`\r\n );\r\n\r\n // Create device (e.g. the product type -> SolarFlow)\r\n await adapter?.extendObject(productKey, {\r\n type: \"device\",\r\n common: {\r\n name: {\r\n de: `${device.productName} (${productKey})`,\r\n en: `${device.productName} (${productKey})`,\r\n },\r\n },\r\n native: {},\r\n });\r\n\r\n // Create channel (e.g. the device specific key)\r\n await adapter?.extendObject(productKey + \".\" + deviceKey, {\r\n type: \"channel\",\r\n common: {\r\n name: {\r\n de: `${device.name} (${deviceKey})`,\r\n en: `${device.name} (${deviceKey})`,\r\n },\r\n },\r\n native: {},\r\n });\r\n\r\n // Create pack data folder\r\n if (!device.productName.toLocaleLowerCase().includes(\"smart plug\")) {\r\n await adapter?.extendObject(`${productKey}.${deviceKey}.packData`, {\r\n type: \"channel\",\r\n common: {\r\n name: {\r\n de: \"Batterie Packs\",\r\n en: \"Battery packs\",\r\n },\r\n },\r\n native: {},\r\n });\r\n }\r\n\r\n const states = getStateDefinition(productName);\r\n\r\n if (states.length == 0) {\r\n adapter.log.error(\r\n `[createSolarFlowLocalStates] Unknown product (${device.productKey}/'${device.productName}'). We cannot create control states! Please contact the developer!`\r\n );\r\n return;\r\n }\r\n\r\n states.forEach(async (state: ISolarflowState) => {\r\n await adapter?.extendObject(`${productKey}.${deviceKey}.${state.title}`, {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: state.nameDe,\r\n en: state.nameEn,\r\n },\r\n type: state.type,\r\n desc: state.title,\r\n role: state.role,\r\n read: true,\r\n write: false,\r\n unit: state.unit,\r\n states: state.states,\r\n },\r\n native: {},\r\n });\r\n });\r\n\r\n // Set SOC from device\r\n if (\r\n device.electricity &&\r\n !device.productName.toLocaleLowerCase().includes(\"smart plug\")\r\n ) {\r\n await updateSolarFlowState(\r\n adapter,\r\n device.productKey,\r\n device.deviceKey,\r\n \"electricLevel\",\r\n device.electricity\r\n );\r\n }\r\n\r\n // Set sn number from device\r\n if (device.snNumber) {\r\n await updateSolarFlowState(\r\n adapter,\r\n productKey,\r\n deviceKey,\r\n \"snNumber\",\r\n device.snNumber.toString()\r\n );\r\n }\r\n\r\n // Set the ACE connection info if is solarflow hub device\r\n if (\r\n (device.productName.toLocaleLowerCase() == \"solarflow hub 2000\" ||\r\n device.productName.toLocaleLowerCase() == \"solarflow2.0\") &&\r\n device._connectedWithAce != null &&\r\n device._connectedWithAce != undefined\r\n ) {\r\n await updateSolarFlowState(\r\n adapter,\r\n device.productKey,\r\n device.deviceKey,\r\n \"connectedWithAce\",\r\n device._connectedWithAce\r\n );\r\n }\r\n\r\n // Set product name from device\r\n await updateSolarFlowState(\r\n adapter,\r\n productKey,\r\n deviceKey,\r\n \"productName\",\r\n device.productName\r\n );\r\n\r\n // Set wifi state from device\r\n await updateSolarFlowState(\r\n adapter,\r\n productKey,\r\n deviceKey,\r\n \"wifiState\",\r\n device.wifiStatus ? \"Connected\" : \"Disconnected\"\r\n );\r\n\r\n if (!device.productName.toLocaleLowerCase().includes(\"smart plug\")) {\r\n // Create control states only when using App MQTT servers - and not the fallback one!\r\n if (!adapter.config.useFallbackService) {\r\n await createControlStates(adapter, productKey, deviceKey, productName);\r\n }\r\n\r\n if (adapter.config.useCalculation) {\r\n // Create calculations folder\r\n await adapter?.extendObject(`${productKey}.${deviceKey}.calculations`, {\r\n type: \"channel\",\r\n common: {\r\n name: {\r\n de: \"Berechnungen f\u00FCr Ger\u00E4t \" + deviceKey,\r\n en: \"Calculations for Device \" + deviceKey,\r\n },\r\n },\r\n native: {},\r\n });\r\n\r\n await createCalculationStates(adapter, productKey, deviceKey);\r\n } else {\r\n //await deleteCalculationStates(adapter, productKey, deviceKey);\r\n }\r\n }\r\n};\r\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAA6B;AAC7B,uBAA0B;AAC1B,uBAA0B;AAC1B,uBAA0B;AAC1B,yBAA4B;AAC5B,mCAAsC;AACtC,gCAAmC;AAInC,4BAAqC;AACrC,qCAAwC;AACxC,iCAAoC;AACpC,qBAA6C;AAGtC,MAAM,qBAAqB,CAAC,gBAA2C;AAC5E,UAAQ,YAAY,kBAAkB,GAAG;AAAA,IACvC,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;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ACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,aAAa,cAAc;AAAA,EACpC;AAEA,MAAI,CAAC,OAAO,YAAY,kBAAkB,EAAE,SAAS,YAAY,GAAG;AAElE,QAAI,CAAC,QAAQ,OAAO,oBAAoB;AACtC,gBAAM,gDAAoB,SAAS,YAAY,WAAW,WAAW;AAAA,IACvE;AAEA,QAAI,QAAQ,OAAO,gBAAgB;AAEjC,aAAM,mCAAS,aAAa,GAAG,UAAU,IAAI,SAAS,iBAAiB;AAAA,QACrE,MAAM;AAAA,QACN,QAAQ;AAAA,UACN,MAAM;AAAA,YACJ,IAAI,kCAA4B;AAAA,YAChC,IAAI,6BAA6B;AAAA,UACnC;AAAA,QACF;AAAA,QACA,QAAQ,CAAC;AAAA,MACX;AAEA,gBAAM,wDAAwB,SAAS,YAAY,SAAS;AAAA,IAC9D,OAAO;AAAA,IAEP;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/helpers/helpers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/helpers/helpers.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/indent */\n\nexport const getProductNameFromProductKey = (productKey: string): string => {\n switch (productKey.toLowerCase()) {\n case \"73bktv\":\n return \"solarflow2.0\";\n case \"a8yh63\":\n return \"solarflow hub 2000\";\n case \"ywf7hv\":\n return \"solarflow aio zy\";\n case \"ja72u0ha\":\n return \"hyper 2000\";\n case \"gda3tb\":\n return \"hyper 2000\";\n case \"b3dxda\":\n \"hyper 2000\";\n case \"8bm93h\":\n return \"ace 1500\";\n case \"bc8b7f\":\n return \"solarflow 2400 ac\";\n case \"b1nhmc\":\n return \"solarflow 800\";\n default:\n return \"\";\n }\n};\n\nexport const getMinAndMaxOutputLimitForProductKey = (\n productKey: string,\n limit: number\n): number => {\n const productName = getProductNameFromProductKey(productKey);\n\n if (limit < 100 && limit != 90 && limit != 60 && limit != 30 && limit != 0) {\n // NUR Solarflow HUB: Das Limit kann unter 100 nur in 30er Schritten gesetzt werden, dH. 30/60/90/100, wir rechnen das also um\n if (\n limit < 100 &&\n limit > 90 &&\n !productName?.includes(\"hyper\") &&\n !productName?.includes(\"2400 ac\") &&\n !productName?.includes(\"solarflow 800\")\n ) {\n limit = 90;\n } else if (\n limit > 60 &&\n limit < 90 &&\n !productName?.includes(\"hyper\") &&\n !productName?.includes(\"2400 ac\") &&\n !productName?.includes(\"solarflow 800\")\n ) {\n limit = 60;\n } else if (\n limit > 30 &&\n limit < 60 &&\n !productName?.includes(\"hyper\") &&\n !productName?.includes(\"2400 ac\") &&\n !productName?.includes(\"solarflow 800\")\n ) {\n limit = 30;\n } else if (limit < 30) {\n limit = 30;\n }\n }\n\n switch (productName?.toLocaleLowerCase()) {\n case \"hyper 2000\":\n if (limit > 1200) {\n limit = 1200;\n }\n break;\n case \"solarflow 800\":\n if (limit > 800) {\n limit = 800;\n }\n break;\n case \"solarflow2.0\":\n if (limit > 1200) {\n limit = 1200;\n }\n break;\n case \"solarflow hub 2000\":\n if (limit > 1200) {\n limit = 1200;\n }\n break;\n case \"solarflow aio zy\":\n if (limit > 1200) {\n limit = 1200;\n }\n break;\n case \"solarflow 800 pro\":\n if (limit > 800) {\n limit = 800;\n }\n break;\n case \"solarflow 2400 ac\":\n if (limit > 2400) {\n limit = 2400;\n }\n break;\n default:\n break;\n }\n\n return limit;\n};\n\nexport const getMinAndMaxInputLimitForProductKey = (\n productKey: string,\n limit: number\n): number => {\n let maxLimit = 900;\n\n const productName = getProductNameFromProductKey(productKey);\n\n if (productName?.includes(\"hyper\")) {\n maxLimit = 1200;\n }\n\n if (productName?.includes(\"2400 ac\")) {\n maxLimit = 2400;\n }\n\n if (productName?.includes(\"solarflow 800\")) {\n maxLimit = 800;\n }\n\n if (productName?.includes(\"ace\")) {\n // Das Limit kann nur in 100er Schritten gesetzt werden\n limit = Math.ceil(limit / 100) * 100;\n }\n\n if (limit < 0) {\n limit = 0;\n } else if (limit > 0 && limit <= 30) {\n limit = 30;\n } else if (limit > maxLimit) {\n limit = maxLimit;\n }\n\n return limit;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,+BAA+B,CAAC,eAA+B;AAC1E,UAAQ,WAAW,YAAY,GAAG;AAAA,IAChC,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH;AAAA,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/indent */\n\nexport const getProductNameFromProductKey = (productKey: string): string => {\n switch (productKey.toLowerCase()) {\n case \"73bktv\":\n return \"solarflow2.0\";\n case \"a8yh63\":\n return \"solarflow hub 2000\";\n case \"ywf7hv\":\n return \"solarflow aio zy\";\n case \"ja72u0ha\":\n return \"hyper 2000\";\n case \"gda3tb\":\n return \"hyper 2000\";\n case \"b3dxda\":\n return \"hyper 2000\";\n case \"8bm93h\":\n return \"ace 1500\";\n case \"bc8b7f\":\n return \"solarflow 2400 ac\";\n case \"b1nhmc\":\n return \"solarflow 800\";\n default:\n return \"\";\n }\n};\n\nexport const getMinAndMaxOutputLimitForProductKey = (\n productKey: string,\n limit: number\n): number => {\n const productName = getProductNameFromProductKey(productKey);\n\n if (limit < 100 && limit != 90 && limit != 60 && limit != 30 && limit != 0) {\n // NUR Solarflow HUB: Das Limit kann unter 100 nur in 30er Schritten gesetzt werden, dH. 30/60/90/100, wir rechnen das also um\n if (\n limit < 100 &&\n limit > 90 &&\n !productName?.includes(\"hyper\") &&\n !productName?.includes(\"2400 ac\") &&\n !productName?.includes(\"solarflow 800\")\n ) {\n limit = 90;\n } else if (\n limit > 60 &&\n limit < 90 &&\n !productName?.includes(\"hyper\") &&\n !productName?.includes(\"2400 ac\") &&\n !productName?.includes(\"solarflow 800\")\n ) {\n limit = 60;\n } else if (\n limit > 30 &&\n limit < 60 &&\n !productName?.includes(\"hyper\") &&\n !productName?.includes(\"2400 ac\") &&\n !productName?.includes(\"solarflow 800\")\n ) {\n limit = 30;\n } else if (limit < 30) {\n limit = 30;\n }\n }\n\n switch (productName?.toLocaleLowerCase()) {\n case \"hyper 2000\":\n if (limit > 1200) {\n limit = 1200;\n }\n break;\n case \"solarflow 800\":\n if (limit > 800) {\n limit = 800;\n }\n break;\n case \"solarflow2.0\":\n if (limit > 1200) {\n limit = 1200;\n }\n break;\n case \"solarflow hub 2000\":\n if (limit > 1200) {\n limit = 1200;\n }\n break;\n case \"solarflow aio zy\":\n if (limit > 1200) {\n limit = 1200;\n }\n break;\n case \"solarflow 800 pro\":\n if (limit > 800) {\n limit = 800;\n }\n break;\n case \"solarflow 2400 ac\":\n if (limit > 2400) {\n limit = 2400;\n }\n break;\n default:\n break;\n }\n\n return limit;\n};\n\nexport const getMinAndMaxInputLimitForProductKey = (\n productKey: string,\n limit: number\n): number => {\n let maxLimit = 900;\n\n const productName = getProductNameFromProductKey(productKey);\n\n if (productName?.includes(\"hyper\")) {\n maxLimit = 1200;\n }\n\n if (productName?.includes(\"2400 ac\")) {\n maxLimit = 2400;\n }\n\n if (productName?.includes(\"solarflow 800\")) {\n maxLimit = 800;\n }\n\n if (productName?.includes(\"ace\")) {\n // Das Limit kann nur in 100er Schritten gesetzt werden\n limit = Math.ceil(limit / 100) * 100;\n }\n\n if (limit < 0) {\n limit = 0;\n } else if (limit > 0 && limit <= 30) {\n limit = 30;\n } else if (limit > maxLimit) {\n limit = maxLimit;\n }\n\n return limit;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,+BAA+B,CAAC,eAA+B;AAC1E,UAAQ,WAAW,YAAY,GAAG;AAA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,gBAAQ;AAAA,MACV;AACA;AAAA,IACF,KAAK;AACH,UAAI,QAAQ,KAAK;AACf,gBAAQ;AAAA,MACV;AACA;AAAA,IACF,KAAK;AACH,UAAI,QAAQ,MAAM;AAChB,gBAAQ;AAAA,MACV;AACA;AAAA,IACF;AACE;AAAA,EACJ;AAEA,SAAO;AACT;AAEO,MAAM,sCAAsC,CACjD,YACA,UACW;AACX,MAAI,WAAW;AAEf,QAAM,cAAc,6BAA6B,UAAU;AAE3D,MAAI,2CAAa,SAAS,UAAU;AAClC,eAAW;AAAA,EACb;AAEA,MAAI,2CAAa,SAAS,YAAY;AACpC,eAAW;AAAA,EACb;AAEA,MAAI,2CAAa,SAAS,kBAAkB;AAC1C,eAAW;AAAA,EACb;AAEA,MAAI,2CAAa,SAAS,QAAQ;AAEhC,YAAQ,KAAK,KAAK,QAAQ,GAAG,IAAI;AAAA,EACnC;AAEA,MAAI,QAAQ,GAAG;AACb,YAAQ;AAAA,EACV,WAAW,QAAQ,KAAK,SAAS,IAAI;AACnC,YAAQ;AAAA,EACV,WAAW,QAAQ,UAAU;AAC3B,YAAQ;AAAA,EACV;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/io-package.json
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "zendure-solarflow",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.4",
|
|
5
5
|
"news": {
|
|
6
|
-
"2.0.
|
|
7
|
-
"en": "
|
|
8
|
-
"de": "
|
|
6
|
+
"2.0.4": {
|
|
7
|
+
"en": "Fix creation of control states on new Hyper 2000 v3\nUpdates dependencies",
|
|
8
|
+
"de": "Behebung der Erstellung von Steuerungszuständen auf dem neuen Hyper 2000 v3\nAktualisiert Abhängigkeiten",
|
|
9
|
+
"ru": "Исправлена создания состояний управления на новом Hyper 2000 v3\nОбновлены зависимости",
|
|
10
|
+
"pt": "Correção da criação de estados de controle no novo Hyper 2000 v3\nAtualiza dependências",
|
|
11
|
+
"nl": "Oplossing voor het aanmaken van bedieningstoestanden op nieuwe Hyper 2000 v3\nWerk dependencies bij",
|
|
12
|
+
"fr": "Corriger la création des états de contrôle sur le nouveau Hyper 2000 v3\nMise à jour des dépendances",
|
|
13
|
+
"it": "Correzione della creazione degli stati di controllo su Hyper 2000 v3\nAggiornamento delle dipendenze",
|
|
14
|
+
"es": "Corregir la creación de estados de control en el nuevo Hyper 2000 v3.\nActualización de dependencias",
|
|
15
|
+
"pl": "Napraw utworzenie stanów kontrolnych w nowym Hyper 2000 v3\nAktualizacja zależności",
|
|
16
|
+
"uk": "Виправлення створення станів управління на новому Hyper 2000 v3.\nОновлення залежностей",
|
|
17
|
+
"zh-cn": "修复在新的Hyper 2000 v3上创建控制状态\n更新依赖项"
|
|
18
|
+
},
|
|
19
|
+
"2.0.3": {
|
|
20
|
+
"en": "Added 'B3Dxda' as new Hyper 2000 productKey. Removed parameter 'upTime' and 'pullTime' from 'setDeviceAutomationInOutLimit'. TEST: Use 'setDeviceAutomationInOutLimit' to let HUB1200/HUB2000 charge with connected ACE 1500",
|
|
21
|
+
"de": "B3Dxda' als neuer Hyper 2000 productKey hinzugefügt. Parameter 'upTime' und 'pullTime' aus 'setDeviceAutomationInOutLimit' entfernt. TEST: Verwenden Sie 'setDeviceAutomationInOutLimit', um HUB1200/HUB2000 mit angeschlossenem ACE 1500 laden zu lassen.",
|
|
9
22
|
"ru": "Добавлен 'B3Dxda' в качестве нового ключа устройства Hyper 2000. Удалены параметры 'upTime' и 'pullTime' из 'setDeviceAutomationInOutLimit'. ТЕСТ: Используйте 'setDeviceAutomationInOutLimit', чтобы позволить HUB1200/HUB2000 заряжаться с подключенным ACE 1500.",
|
|
10
|
-
"pt": "Adicionado 'B3Dxda' como nova
|
|
11
|
-
"nl": "B3Dxda' toegevoegd als nieuwe Hyper 2000
|
|
23
|
+
"pt": "Adicionado 'B3Dxda' como nova productKey Hyper 2000. Removido o parâmetro 'upTime' e 'pullTime' de 'setDeviceAutomationInOutLimit'. TESTE: Utilizar 'setDeviceAutomationInOutLimit' para permitir que o HUB1200/HUB2000 carregue com o ACE 1500 ligado",
|
|
24
|
+
"nl": "B3Dxda' toegevoegd als nieuwe Hyper 2000 productKey. Parameter 'upTime' en 'pullTime' verwijderd uit 'setDeviceAutomationInOutLimit'. TEST: Gebruik 'setDeviceAutomationInOutLimit' om HUB1200/HUB2000 te laten laden met aangesloten ACE 1500.",
|
|
12
25
|
"fr": "Ajout de 'B3Dxda' comme nouvelle clé de périphérique Hyper 2000. Suppression des paramètres 'upTime' et 'pullTime' de 'setDeviceAutomationInOutLimit'. TEST : Utilisez 'setDeviceAutomationInOutLimit' pour permettre au HUB1200/HUB2000 de se recharger avec un ACE 1500 connecté.",
|
|
13
|
-
"it": "Aggiunto 'B3Dxda' come nuovo
|
|
14
|
-
"es": "Añadido 'B3Dxda' como nuevo
|
|
26
|
+
"it": "Aggiunto 'B3Dxda' come nuovo productKey Hyper 2000. Rimosso il parametro 'upTime' e 'pullTime' da 'setDeviceAutomationInOutLimit'. TEST: utilizzare 'setDeviceAutomationInOutLimit' per consentire a HUB1200/HUB2000 di caricarsi con l'ACE 1500 collegato.",
|
|
27
|
+
"es": "Añadido 'B3Dxda' como nuevo productKey de Hyper 2000. Eliminados los parámetros 'upTime' y 'pullTime' de 'setDeviceAutomationInOutLimit'. PRUEBA: Utiliza 'setDeviceAutomationInOutLimit' para que HUB1200/HUB2000 se cargue con ACE 1500 conectado.",
|
|
15
28
|
"pl": "Dodano \"B3Dxda\" jako nowy klucz urządzenia Hyper 2000. Usunięto parametr 'upTime' i 'pullTime' z 'setDeviceAutomationInOutLimit'. TEST: Użyj 'setDeviceAutomationInOutLimit', aby umożliwić ładowanie HUB1200/HUB2000 z podłączonym ACE 1500.",
|
|
16
|
-
"uk": "Додано 'B3Dxda' як новий Hyper 2000
|
|
17
|
-
"zh-cn": "Added 'B3Dxda' as new Hyper 2000
|
|
29
|
+
"uk": "Додано 'B3Dxda' як новий Hyper 2000 productKey. Видалено параметри 'upTime' та 'pullTime' з 'setDeviceAutomationInOutLimit'. ТЕСТ: Використовуйте 'setDeviceAutomationInOutLimit', щоб дозволити HUB1200/HUB2000 заряджатися з підключеним ACE 1500",
|
|
30
|
+
"zh-cn": "Added 'B3Dxda' as new Hyper 2000 productKey. Removed parameter 'upTime' and 'pullTime' from 'setDeviceAutomationInOutLimit'. TEST: Use 'setDeviceAutomationInOutLimit' to let HUB1200/HUB2000 charge with connected ACE 1500"
|
|
18
31
|
},
|
|
19
32
|
"2.0.1": {
|
|
20
33
|
"en": "Small fix MQTT service",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "Dodaj inteligentny parametr sterowania trybem dla większej liczby urządzeń",
|
|
81
94
|
"uk": "Додавання параметра керування смарт-режимом для більших пристроїв",
|
|
82
95
|
"zh-cn": "为更多设备添加智能模式控制参数"
|
|
83
|
-
},
|
|
84
|
-
"1.15.3": {
|
|
85
|
-
"en": "Match case sensitive product key for SF 2400 AC and SF 800 in settings if local mode is used\nAdd sensor and control of \"SmartMode\"",
|
|
86
|
-
"de": "Passender Case sensitiver Produktschlüssel für SF 2400 AC und SF 800 in Einstellungen, wenn der lokale Modus verwendet wird\nSensor und Steuerung von \"SmartMode\" hinzufügen",
|
|
87
|
-
"ru": "Ключ для SF 2400 AC и SF 800 в настройках, если используется локальный режим\nДобавить сенсор и управление «SmartMode»",
|
|
88
|
-
"pt": "Chave de produto sensível à caixa para SF 2400 AC e SF 800 em configurações se o modo local for usado\nAdicionar sensor e controle de \"SmartMode\"",
|
|
89
|
-
"nl": "Match hoofdlettergevoelige productsleutel voor SF 2400 AC en SF 800 in instellingen als lokale modus wordt gebruikt\nVoeg sensor en bediening van \"SmartMode\" toe",
|
|
90
|
-
"fr": "Clé de produit sensible à la casse pour SF 2400 AC et SF 800 dans les paramètres si le mode local est utilisé\nAjouter le capteur et le contrôle de \"SmartMode\"",
|
|
91
|
-
"it": "Chiave di prodotto sensibile caso di corrispondenza per SF 2400 AC e SF 800 nelle impostazioni se la modalità locale viene utilizzata\nAggiungi sensore e controllo di \"SmartMode\"",
|
|
92
|
-
"es": "Clave de producto sensible de caso de coincidencia para SF 2400 AC y SF 800 en ajustes si se utiliza el modo local\nAñadir sensor y control de \"SmartMode\"",
|
|
93
|
-
"pl": "Klucz produktu wrażliwego na dopasowanie dla SF 2400 AC i SF 800 w ustawieniach w trybie lokalnym\nDodaj czujnik i sterowanie \"SmartMode\"",
|
|
94
|
-
"uk": "У разі використання чутливого продукту для SF 2400 AC та SF 800 у налаштуваннях, якщо використовується локальний режим\nДодати датчик і контроль \"SmartMode\"",
|
|
95
|
-
"zh-cn": "如果使用本地模式, 匹配 SF 2400 AC 和 SF 800 的大小写敏感产品密钥\n添加“ SmartMode” 的传感器和控制"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|