iobroker.ebus 3.6.6 → 3.6.8
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 +7 -7
- package/lib/tools.js +0 -101
package/README.md
CHANGED
|
@@ -76,6 +76,12 @@ in /opt/iobroker/node_modules/iobroker.ebus/lib/scripts you can find a scripts t
|
|
|
76
76
|
Placeholder for the next version (at the beginning of the line):
|
|
77
77
|
### **WORK IN PROGRESS**
|
|
78
78
|
-->
|
|
79
|
+
### 3.6.8 (2025-10-04)
|
|
80
|
+
* (René) update dependencies + changes based on adapter checker
|
|
81
|
+
|
|
82
|
+
### 3.6.7 (2025-09-06)
|
|
83
|
+
* (René) dependencies updated and bug fix based on adapter checker
|
|
84
|
+
|
|
79
85
|
### 3.6.6 (2025-08-22)
|
|
80
86
|
* (René) see issue #430: bug fix
|
|
81
87
|
|
package/io-package.json
CHANGED
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "ebus",
|
|
4
|
-
"version": "3.6.
|
|
4
|
+
"version": "3.6.8",
|
|
5
5
|
"news": {
|
|
6
|
-
"3.6.
|
|
7
|
-
"en": "
|
|
8
|
-
"de": "
|
|
9
|
-
"ru": "
|
|
10
|
-
"pt": "
|
|
11
|
-
"nl": "
|
|
12
|
-
"fr": "
|
|
13
|
-
"it": "
|
|
14
|
-
"es": "
|
|
15
|
-
"pl": "
|
|
16
|
-
"uk": "
|
|
17
|
-
"zh-cn": "
|
|
6
|
+
"3.6.8": {
|
|
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
18
|
},
|
|
19
|
-
"3.6.
|
|
19
|
+
"3.6.7": {
|
|
20
|
+
"en": "dependencies updated and bug fix based on adapter checker",
|
|
21
|
+
"de": "abhängigkeiten aktualisiert und fehler beheben basierend auf adapter checker",
|
|
22
|
+
"ru": "обновленные зависимости и исправление ошибок на основе проверки адаптера",
|
|
23
|
+
"pt": "dependências atualizadas e correção de erros com base no verificador do adaptador",
|
|
24
|
+
"nl": "afhankelijkheden bijgewerkt en bug fix op basis van adaptercontrole",
|
|
25
|
+
"fr": "dépendances mises à jour et correction de bugs basée sur adaptateur checker",
|
|
26
|
+
"it": "dipendenze aggiornate e correzione bug in base all'adattatore checker",
|
|
27
|
+
"es": "dependencias actualizadas y corrección de errores basado en el control de adaptador",
|
|
28
|
+
"pl": "aktualizacja zależności i naprawianie błędów w oparciu o sprawdzacz adaptera",
|
|
29
|
+
"uk": "залежностей, оновлено і виправлення помилок на основі перевірки адаптера",
|
|
30
|
+
"zh-cn": "基于适配器检查器更新的依赖性和错误修正"
|
|
31
|
+
},
|
|
32
|
+
"3.6.6": {
|
|
20
33
|
"en": "see issue #430: bug fix",
|
|
21
34
|
"de": "siehe ausgabe #430: bugfix",
|
|
22
35
|
"ru": "проблема #430: исправление ошибок",
|
|
@@ -29,19 +42,6 @@
|
|
|
29
42
|
"uk": "переглянути проблему #430: виправлення помилок",
|
|
30
43
|
"zh-cn": "参见第430期: 错误修正"
|
|
31
44
|
},
|
|
32
|
-
"3.6.4": {
|
|
33
|
-
"en": "see issue #430: for history complete datapoint names without instance (e.g. ebus.0) must be used\nchange some logs",
|
|
34
|
-
"de": "siehe ausgabe #430: für die geschichte müssen vollständige datenpunktnamen ohne beispiel (z.b. ebus.0) verwendet werden\neinige protokolle ändern",
|
|
35
|
-
"ru": "проблема no 430: для истории необходимо использовать полные имена точек данных без экземпляра (например, ebus.0)\nизменить некоторые бревна",
|
|
36
|
-
"pt": "ver problema #430: para o histórico devem ser usados nomes completos de pontos de dados sem instância (por exemplo, ebus.0)\nalterar alguns logs",
|
|
37
|
-
"nl": "zie probleem #430: voor de geschiedenis moeten volledige datapointnamen zonder instantie (bijv. ebus.0) worden gebruikt\nsommige logs wijzigen",
|
|
38
|
-
"fr": "voir le numéro 430: pour l'historique, il faut utiliser des noms de datapoints complets sans instance (par exemple ebus.0)\nchanger quelques journaux",
|
|
39
|
-
"it": "vedi numero #430: per la storia devono essere utilizzati nomi di datapoint completi senza istanza (ad esempio ebus.0)\ncambiare alcuni registri",
|
|
40
|
-
"es": "ver número #430: para la historia se deben utilizar nombres completos de datos sin instancia (por ejemplo, ebus.0)\ncambiar algunos registros",
|
|
41
|
-
"pl": "zobacz numer # 430: dla historii należy użyć pełnych nazw punktów danych bez instancji (np. ebus.0)\nzmienić kilka dzienników",
|
|
42
|
-
"uk": "переглянути номер #430: для історії повна назва даних без екземпляра (наприклад, ebus.0)\nзмінити деякі журнали",
|
|
43
|
-
"zh-cn": "参见第430期:对于历史完整的无实例数据点名称(例如ebus.0)必须使用\n更改一些日志"
|
|
44
|
-
},
|
|
45
45
|
"3.6.3": {
|
|
46
46
|
"en": "get version info for ebusd from github if locally not available\nupdate dependencies\nnew testing",
|
|
47
47
|
"de": "versionsinformationen für ebusd von github erhalten, wenn lokal nicht verfügbar\naktualisierung der abhängigkeiten\nneue tests",
|
|
@@ -141,12 +141,12 @@
|
|
|
141
141
|
},
|
|
142
142
|
"dependencies": [
|
|
143
143
|
{
|
|
144
|
-
"js-controller": ">=
|
|
144
|
+
"js-controller": ">=6.0.11"
|
|
145
145
|
}
|
|
146
146
|
],
|
|
147
147
|
"globalDependencies": [
|
|
148
148
|
{
|
|
149
|
-
"admin": ">=7.
|
|
149
|
+
"admin": ">=7.6.17"
|
|
150
150
|
}
|
|
151
151
|
],
|
|
152
152
|
"plugins": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.ebus",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.8",
|
|
4
4
|
"description": "ioBroker ebus Adapter",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "René G.",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@iobroker/adapter-core": "^3.3.2",
|
|
27
|
-
"axios": "^1.
|
|
27
|
+
"axios": "^1.12.2",
|
|
28
28
|
"net": "^1.0.2",
|
|
29
29
|
"promise-socket": "^8.0.0"
|
|
30
30
|
},
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
|
|
34
34
|
"@alcalzone/release-script-plugin-license": "^3.7.0",
|
|
35
35
|
"@alcalzone/release-script-plugin-manual-review": "^3.7.0",
|
|
36
|
-
"@iobroker/adapter-dev": "^1.
|
|
37
|
-
"@iobroker/eslint-config": "^2.0
|
|
38
|
-
"@iobroker/testing": "^5.
|
|
39
|
-
"chai": "^
|
|
40
|
-
"mocha": "^11.7.
|
|
36
|
+
"@iobroker/adapter-dev": "^1.5.0",
|
|
37
|
+
"@iobroker/eslint-config": "^2.2.0",
|
|
38
|
+
"@iobroker/testing": "^5.1.1",
|
|
39
|
+
"chai": "^6.2.0",
|
|
40
|
+
"mocha": "^11.7.4"
|
|
41
41
|
},
|
|
42
42
|
"main": "main.js",
|
|
43
43
|
"bugs": {
|
package/lib/tools.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
const axios = require('axios').default;
|
|
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
|
-
};
|