iobroker.ebus 3.6.7 → 3.6.9
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 -16
- package/package.json +9 -11
- 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.9 (2025-10-21)
|
|
80
|
+
* (René) update dependencies + changes based on adapter checker
|
|
81
|
+
|
|
82
|
+
### 3.6.8 (2025-10-04)
|
|
83
|
+
* (René) update dependencies + changes based on adapter checker
|
|
84
|
+
|
|
79
85
|
### 3.6.7 (2025-09-06)
|
|
80
86
|
* (René) dependencies updated and bug fix based on adapter checker
|
|
81
87
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "ebus",
|
|
4
|
-
"version": "3.6.
|
|
4
|
+
"version": "3.6.9",
|
|
5
5
|
"news": {
|
|
6
|
+
"3.6.9": {
|
|
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
|
+
"3.6.8": {
|
|
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
|
"3.6.7": {
|
|
7
33
|
"en": "dependencies updated and bug fix based on adapter checker",
|
|
8
34
|
"de": "abhängigkeiten aktualisiert und fehler beheben basierend auf adapter checker",
|
|
@@ -67,19 +93,6 @@
|
|
|
67
93
|
"pl": "zmiany sugerowane przez sprawdzacz adaptera",
|
|
68
94
|
"uk": "зміни, запропоновані адаптером",
|
|
69
95
|
"zh-cn": "适配器检查器建议的更改"
|
|
70
|
-
},
|
|
71
|
-
"3.6.0": {
|
|
72
|
-
"en": "new supported ebusd version is 25.1\nversion info added in admin",
|
|
73
|
-
"de": "neue unterstützte ebusd version ist 25.1\nversion info in admin",
|
|
74
|
-
"ru": "новая поддерживаемая версия ebusd 25.1\nинформация о версии добавлена в admin",
|
|
75
|
-
"pt": "nova versão ebusd suportada é 25.1\nversão info adicionado em admin",
|
|
76
|
-
"nl": "nieuwe ondersteunde ebusd versie is 25.1\nversie info toegevoegd in admin",
|
|
77
|
-
"fr": "nouvelle version ebusd prise en charge est 25.1\nversion info ajoutée dans admin",
|
|
78
|
-
"it": "nuova versione ebusd supportata è 25.1\nversione info aggiunto in admin",
|
|
79
|
-
"es": "nueva versión electrónica soportada es 25.1\nversión info añadido en admin",
|
|
80
|
-
"pl": "nowa obsługiwana wersja ebusd to 25.1\ninformacje o wersji dodane w admin",
|
|
81
|
-
"uk": "нова підтримана версія ebusd 25.1\nдодано інформацію про версію в адмін",
|
|
82
|
-
"zh-cn": "新支持的ebusd版本为25.1\n在管理员中添加的版本信息"
|
|
83
96
|
}
|
|
84
97
|
},
|
|
85
98
|
"titleLang": {
|
|
@@ -128,12 +141,12 @@
|
|
|
128
141
|
},
|
|
129
142
|
"dependencies": [
|
|
130
143
|
{
|
|
131
|
-
"js-controller": ">=
|
|
144
|
+
"js-controller": ">=6.0.11"
|
|
132
145
|
}
|
|
133
146
|
],
|
|
134
147
|
"globalDependencies": [
|
|
135
148
|
{
|
|
136
|
-
"admin": ">=7.
|
|
149
|
+
"admin": ">=7.6.17"
|
|
137
150
|
}
|
|
138
151
|
],
|
|
139
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.9",
|
|
4
4
|
"description": "ioBroker ebus Adapter",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "René G.",
|
|
@@ -24,20 +24,18 @@
|
|
|
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
|
},
|
|
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": "^6.0.1",
|
|
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').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
|
-
};
|