iobroker.amtronwallbox 0.3.2 → 0.3.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 +6 -0
- package/io-package.json +29 -29
- package/package.json +11 -13
- package/lib/tools.js +0 -101
package/README.md
CHANGED
|
@@ -54,6 +54,12 @@ Note: Since the boxes have different interfaces, it may be that not all interfac
|
|
|
54
54
|
Placeholder for the next version (at the beginning of the line):
|
|
55
55
|
### **WORK IN PROGRESS**
|
|
56
56
|
-->
|
|
57
|
+
### 0.3.4 (2025-10-21)
|
|
58
|
+
* (René) update dependencies + changes based on adapter checker
|
|
59
|
+
|
|
60
|
+
### 0.3.3 (2025-10-04)
|
|
61
|
+
* (René) update dependencies + changes based on adapter checker
|
|
62
|
+
|
|
57
63
|
### 0.3.2 (2025-06-28)
|
|
58
64
|
* (René) update dependencies
|
|
59
65
|
* (René) new testing
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "amtronwallbox",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.4",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.3.4": {
|
|
7
|
+
"en": "update dependencies + changes based on adapter checker",
|
|
8
|
+
"de": "aktualisierung abhängigkeiten + änderungen basierend auf adapter-checker",
|
|
9
|
+
"ru": "зависимости обновления + изменения на основе проверки адаптера",
|
|
10
|
+
"pt": "atualizar dependências + alterações com base no verificador de adaptadores",
|
|
11
|
+
"nl": "update afhankelijkheden + wijzigingen op basis van adaptercontrole",
|
|
12
|
+
"fr": "mettre à jour les dépendances + les changements basés sur le vérificateur d'adaptateur",
|
|
13
|
+
"it": "aggiornamento dipendenze + modifiche in base all'adattatore checker",
|
|
14
|
+
"es": "dependencias de actualización + cambios basados en el control de adaptador",
|
|
15
|
+
"pl": "aktualizacja zależności + zmiany w oparciu o sprawdzacz adaptera",
|
|
16
|
+
"uk": "оновлення залежності + зміни на основі перевірки адаптера",
|
|
17
|
+
"zh-cn": "根据适配器检查器更新依赖性+变化"
|
|
18
|
+
},
|
|
19
|
+
"0.3.3": {
|
|
20
|
+
"en": "update dependencies + changes based on adapter checker",
|
|
21
|
+
"de": "aktualisierung abhängigkeiten + änderungen basierend auf adapter-checker",
|
|
22
|
+
"ru": "зависимости обновления + изменения на основе проверки адаптера",
|
|
23
|
+
"pt": "atualizar dependências + alterações com base no verificador de adaptadores",
|
|
24
|
+
"nl": "update afhankelijkheden + wijzigingen op basis van adaptercontrole",
|
|
25
|
+
"fr": "mettre à jour les dépendances + les changements basés sur le vérificateur d'adaptateur",
|
|
26
|
+
"it": "aggiornamento dipendenze + modifiche in base all'adattatore checker",
|
|
27
|
+
"es": "dependencias de actualización + cambios basados en el control de adaptador",
|
|
28
|
+
"pl": "aktualizacja zależności + zmiany w oparciu o sprawdzacz adaptera",
|
|
29
|
+
"uk": "оновлення залежності + зміни на основі перевірки адаптера",
|
|
30
|
+
"zh-cn": "根据适配器检查器更新依赖性+变化"
|
|
31
|
+
},
|
|
6
32
|
"0.3.2": {
|
|
7
33
|
"en": "update dependencies\nnew testing",
|
|
8
34
|
"de": "aktualisierung der abhängigkeiten\nneue tests",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "(René) zmiana zależności\n(René) show cron job in log after creation",
|
|
68
94
|
"uk": "(Рене) зміна залежностей\n(René) покажуть на роботу в журналі після створення",
|
|
69
95
|
"zh-cn": "(René) 属地变化\n(René) 创建后在日志中显示 cron 工作"
|
|
70
|
-
},
|
|
71
|
-
"0.2.14": {
|
|
72
|
-
"en": "(René) dependencies updated",
|
|
73
|
-
"de": "(René)",
|
|
74
|
-
"ru": "(René)",
|
|
75
|
-
"pt": "(René) dependências atualizadas",
|
|
76
|
-
"nl": "(René) bijgewerkte afhankelijkheden",
|
|
77
|
-
"fr": "(René) dépendances mises à jour",
|
|
78
|
-
"it": "(René) dipendenze aggiornate",
|
|
79
|
-
"es": "(René) dependencies updated",
|
|
80
|
-
"pl": "Aktualizacja zależności (René)",
|
|
81
|
-
"uk": "(René) залежностей оновлено",
|
|
82
|
-
"zh-cn": "(René) 更新的依赖关系"
|
|
83
|
-
},
|
|
84
|
-
"0.2.13": {
|
|
85
|
-
"en": "(René) just a sentry test",
|
|
86
|
-
"de": "(René) nur einen Test",
|
|
87
|
-
"ru": "(René) просто тест на отправку",
|
|
88
|
-
"pt": "(René) apenas um teste de sentinela",
|
|
89
|
-
"nl": "Een sentimentele test",
|
|
90
|
-
"fr": "(René) juste un test",
|
|
91
|
-
"it": "(René) solo un test di sentina",
|
|
92
|
-
"es": "(René) sólo una prueba de centinela",
|
|
93
|
-
"pl": "(René) – test sanitarny",
|
|
94
|
-
"uk": "(René) просто відправник",
|
|
95
|
-
"zh-cn": "(René) 只是一个发送的试验"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -143,12 +143,12 @@
|
|
|
143
143
|
},
|
|
144
144
|
"dependencies": [
|
|
145
145
|
{
|
|
146
|
-
"js-controller": ">=
|
|
146
|
+
"js-controller": ">=6.0.11"
|
|
147
147
|
}
|
|
148
148
|
],
|
|
149
149
|
"globalDependencies": [
|
|
150
150
|
{
|
|
151
|
-
"admin": ">=7.
|
|
151
|
+
"admin": ">=7.6.17"
|
|
152
152
|
}
|
|
153
153
|
],
|
|
154
154
|
"plugins": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.amtronwallbox",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "ioBroker Adapter for AMTRON wallboxes",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "René G.",
|
|
@@ -24,20 +24,18 @@
|
|
|
24
24
|
"node": ">= 20"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@iobroker/adapter-core": "^3.2
|
|
28
|
-
"axios": "^1.
|
|
29
|
-
"cron": "^4.3.
|
|
27
|
+
"@iobroker/adapter-core": "^3.3.2",
|
|
28
|
+
"axios": "^1.12.2",
|
|
29
|
+
"cron": "^4.3.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@alcalzone/release-script": "^
|
|
33
|
-
"@alcalzone/release-script-plugin-iobroker": "^
|
|
34
|
-
"@alcalzone/release-script-plugin-license": "^
|
|
35
|
-
"@alcalzone/release-script-plugin-manual-review": "^
|
|
36
|
-
"@iobroker/adapter-dev": "^1.
|
|
37
|
-
"@iobroker/eslint-config": "^2.0
|
|
38
|
-
"@iobroker/testing": "^5.
|
|
39
|
-
"chai": "^5.2.0",
|
|
40
|
-
"mocha": "^11.7.1"
|
|
32
|
+
"@alcalzone/release-script": "^5.0.0",
|
|
33
|
+
"@alcalzone/release-script-plugin-iobroker": "^4.0.0",
|
|
34
|
+
"@alcalzone/release-script-plugin-license": "^4.0.0",
|
|
35
|
+
"@alcalzone/release-script-plugin-manual-review": "^4.0.0",
|
|
36
|
+
"@iobroker/adapter-dev": "^1.5.0",
|
|
37
|
+
"@iobroker/eslint-config": "^2.2.0",
|
|
38
|
+
"@iobroker/testing": "^5.1.1"
|
|
41
39
|
},
|
|
42
40
|
"main": "main.js",
|
|
43
41
|
"bugs": {
|
package/lib/tools.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
const axios = require("axios");
|
|
2
|
-
|
|
3
|
-
//Tests whether the given variable is a real object and not an Array
|
|
4
|
-
/**
|
|
5
|
-
* @param {any} it The variable to test
|
|
6
|
-
* @returns {it is Record<string, any>}
|
|
7
|
-
*/
|
|
8
|
-
function isObject(it) {
|
|
9
|
-
// This is necessary because:
|
|
10
|
-
// typeof null === 'object'
|
|
11
|
-
// typeof [] === 'object'
|
|
12
|
-
// [] instanceof Object === true
|
|
13
|
-
return Object.prototype.toString.call(it) === "[object Object]";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Tests whether the given variable is really an Array
|
|
17
|
-
/**
|
|
18
|
-
* @param {any} it The variable to test
|
|
19
|
-
* @returns {it is any[]}
|
|
20
|
-
*/
|
|
21
|
-
function isArray(it) {
|
|
22
|
-
if (typeof Array.isArray === "function") {
|
|
23
|
-
return Array.isArray(it);
|
|
24
|
-
}
|
|
25
|
-
return Object.prototype.toString.call(it) === "[object Array]";
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
//Translates text to the target language. Automatically chooses the right translation API.
|
|
29
|
-
/**
|
|
30
|
-
* @param {string} text The text to translate
|
|
31
|
-
* @param {string} targetLang The target languate
|
|
32
|
-
* @param {string} [yandexApiKey] The yandex API key. You can create one for free at https://translate.yandex.com/developers
|
|
33
|
-
* @returns {Promise<string>}
|
|
34
|
-
*/
|
|
35
|
-
async function translateText(text, targetLang, yandexApiKey) {
|
|
36
|
-
if (targetLang === "en") {
|
|
37
|
-
return text;
|
|
38
|
-
} else if (!text) {
|
|
39
|
-
return "";
|
|
40
|
-
}
|
|
41
|
-
if (yandexApiKey) {
|
|
42
|
-
return translateYandex(text, targetLang, yandexApiKey);
|
|
43
|
-
} else {
|
|
44
|
-
return translateGoogle(text, targetLang);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
//Translates text with Yandex API
|
|
49
|
-
/**
|
|
50
|
-
* @param {string} text The text to translate
|
|
51
|
-
* @param {string} targetLang The target languate
|
|
52
|
-
* @param {string} apiKey The yandex API key. You can create one for free at https://translate.yandex.com/developers
|
|
53
|
-
* @returns {Promise<string>}
|
|
54
|
-
*/
|
|
55
|
-
async function translateYandex(text, targetLang, apiKey) {
|
|
56
|
-
if (targetLang === "zh-cn") {
|
|
57
|
-
targetLang = "zh";
|
|
58
|
-
}
|
|
59
|
-
try {
|
|
60
|
-
const url = `https://translate.yandex.net/api/v1.5/tr.json/translate?key=${apiKey}&text=${encodeURIComponent(text)}&lang=en-${targetLang}`;
|
|
61
|
-
const response = await axios({url, timeout: 15000});
|
|
62
|
-
if (response.data && response.data.text && isArray(response.data.text)) {
|
|
63
|
-
return response.data.text[0];
|
|
64
|
-
}
|
|
65
|
-
throw new Error("Invalid response for translate request");
|
|
66
|
-
} catch (e) {
|
|
67
|
-
throw new Error(`Could not translate to "${targetLang}": ${e}`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
//Translates text with Google API
|
|
72
|
-
/**
|
|
73
|
-
* @param {string} text The text to translate
|
|
74
|
-
* @param {string} targetLang The target languate
|
|
75
|
-
* @returns {Promise<string>}
|
|
76
|
-
*/
|
|
77
|
-
async function translateGoogle(text, targetLang) {
|
|
78
|
-
try {
|
|
79
|
-
const url = `http://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${targetLang}&dt=t&q=${encodeURIComponent(text)}&ie=UTF-8&oe=UTF-8`;
|
|
80
|
-
const response = await axios({url, timeout: 15000});
|
|
81
|
-
if (isArray(response.data)) {
|
|
82
|
-
// we got a valid response
|
|
83
|
-
return response.data[0][0][0];
|
|
84
|
-
}
|
|
85
|
-
throw new Error("Invalid response for translate request");
|
|
86
|
-
} catch (e) {
|
|
87
|
-
if (e.response && e.response.status === 429) {
|
|
88
|
-
throw new Error(
|
|
89
|
-
`Could not translate to "${targetLang}": Rate-limited by Google Translate`
|
|
90
|
-
);
|
|
91
|
-
} else {
|
|
92
|
-
throw new Error(`Could not translate to "${targetLang}": ${e}`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
module.exports = {
|
|
98
|
-
isArray,
|
|
99
|
-
isObject,
|
|
100
|
-
translateText
|
|
101
|
-
};
|