iobroker.hm-rpc 1.14.49 → 1.15.2
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/LICENSE +1 -1
- package/README.md +14 -1
- package/admin/i18n/de/translations.json +23 -0
- package/admin/i18n/en/translations.json +23 -0
- package/admin/i18n/es/translations.json +23 -0
- package/admin/i18n/fr/translations.json +23 -0
- package/admin/i18n/it/translations.json +23 -0
- package/admin/i18n/nl/translations.json +23 -0
- package/admin/i18n/pl/translations.json +23 -0
- package/admin/i18n/pt/translations.json +23 -0
- package/admin/i18n/ru/translations.json +23 -0
- package/admin/i18n/zh-cn/translations.json +23 -0
- package/admin/icons/HmIP-STE2-PCB.png +0 -0
- package/admin/icons/denon.png +0 -0
- package/admin/icons/removeBackground.js +44 -0
- package/admin/words.js +1 -1
- package/build/lib/gulptools.d.ts +20 -0
- package/{lib → build/lib}/gulptools.js +19 -18
- package/build/lib/gulptools.js.map +1 -0
- package/build/lib/images.d.ts +386 -0
- package/{lib → build/lib}/images.js +10 -7
- package/build/lib/images.js.map +1 -0
- package/build/lib/roles.d.ts +104 -0
- package/build/lib/roles.js +108 -0
- package/build/lib/roles.js.map +1 -0
- package/build/lib/tools.d.ts +13 -0
- package/{lib → build/lib}/tools.js +15 -22
- package/build/lib/tools.js.map +1 -0
- package/{main.js → build/main.js} +363 -423
- package/io-package.json +49 -174
- package/package.json +36 -9
- package/doc/HM_XmlRpc_API.pdf +0 -0
- package/lib/meta.js +0 -37856
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -151,6 +151,19 @@ via or/and operator. The then clause of the program can remain empty. Now your s
|
|
|
151
151
|
Placeholder for the next version (at the beginning of the line):
|
|
152
152
|
### __WORK IN PROGRESS__
|
|
153
153
|
-->
|
|
154
|
+
### 1.15.2 (2022-02-02)
|
|
155
|
+
* (foxriver76) we also fixed type of default value if boolean on heating groups
|
|
156
|
+
|
|
157
|
+
### 1.15.1 (2022-02-02)
|
|
158
|
+
* (foxriver76) we fixxed type of default value and min/max of heating groups (closes #443)
|
|
159
|
+
|
|
160
|
+
### 1.15.0 (2021-12-26)
|
|
161
|
+
* (foxriver76) added image for `HmIP-STE2-PCB`
|
|
162
|
+
* (foxriver76) we now handle `replaceDevice` requests by deleting old device and creating new one (closes #420)
|
|
163
|
+
|
|
164
|
+
### 1.14.50 (2021-11-18)
|
|
165
|
+
* (foxriver76) `meta.roles` is no longer an object, because it is kept in RAM anyway (closes #407)
|
|
166
|
+
|
|
154
167
|
### 1.14.49 (2021-11-18)
|
|
155
168
|
* (foxriver76) handle cases where we cannot retrive `meta.roles` (addresses #407)
|
|
156
169
|
|
|
@@ -338,7 +351,7 @@ of this approach (more requests to CCU on first setup)
|
|
|
338
351
|
|
|
339
352
|
The MIT License (MIT)
|
|
340
353
|
|
|
341
|
-
Copyright (c) 2014-
|
|
354
|
+
Copyright (c) 2014-2022 bluefox <dogafox@gmail.com>
|
|
342
355
|
|
|
343
356
|
Copyright (c) 2014 hobbyquaker
|
|
344
357
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Adapter Address": "Adapter Adresse",
|
|
3
|
+
"Adapter Callback Address": "Adapter Callback Adresse",
|
|
4
|
+
"Adapter Port": "Adapter Port",
|
|
5
|
+
"Additional settings": "Zusätzliche Einstellungen",
|
|
6
|
+
"BIN-RPC does not work with HTTPS. HTTPS has been disabled.": "BIN-RPC ist nicht HTTPS kompatibel. HTTPS wurde deaktiviert.",
|
|
7
|
+
"Check communication interval (sec)": "Verbindungs-Test Intervall(s)",
|
|
8
|
+
"Daemon": "Daemon",
|
|
9
|
+
"Don't delete devices": "Geräte nicht löschen bei Adapterstart",
|
|
10
|
+
"Force objects re-init": "Geräte neu einlesen (einmalig)",
|
|
11
|
+
"HomeMatic Address": "HomeMatic Adresse",
|
|
12
|
+
"HomeMatic Port": "HomeMatic Port",
|
|
13
|
+
"Homematic RPC adapter settings": "Homematic RPC Adapter Einstellungen",
|
|
14
|
+
"Listen on all IPs": "Anfragen für alle IPs beantworten",
|
|
15
|
+
"Ok": "Ok",
|
|
16
|
+
"Password": "Passwort",
|
|
17
|
+
"Please specify callback address": "Bitte Callback IP-Adresse eingeben.",
|
|
18
|
+
"Protocol": "Protokoll",
|
|
19
|
+
"Reconnect interval (sec)": "Wiederverbindungs-Intervall(sek)",
|
|
20
|
+
"This IP is unreachable from %s": "Diese IP ist nicht erreichbar von %s",
|
|
21
|
+
"Use https": "HTTPS benutzen",
|
|
22
|
+
"Username": "Benutzername"
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Adapter Address": "Adapter Address",
|
|
3
|
+
"Adapter Callback Address": "Adapter Callback Address",
|
|
4
|
+
"Adapter Port": "Adapter Port",
|
|
5
|
+
"Additional settings": "Additional settings",
|
|
6
|
+
"BIN-RPC does not work with HTTPS. HTTPS has been disabled.": "BIN-RPC does not work with HTTPS. HTTPS has been disabled.",
|
|
7
|
+
"Check communication interval (sec)": "Check communication interval(sec)",
|
|
8
|
+
"Daemon": "Daemon",
|
|
9
|
+
"Don't delete devices": "Don't delete devices on adapter start",
|
|
10
|
+
"Force objects re-init": "Synchronize objects (once)",
|
|
11
|
+
"HomeMatic Address": "HomeMatic Address",
|
|
12
|
+
"HomeMatic Port": "HomeMatic Port",
|
|
13
|
+
"Homematic RPC adapter settings": "Homematic RPC adapter settings",
|
|
14
|
+
"Listen on all IPs": "Listen on all IPs",
|
|
15
|
+
"Ok": "Ok",
|
|
16
|
+
"Password": "Password",
|
|
17
|
+
"Please specify callback address": "Please specify callback address.",
|
|
18
|
+
"Protocol": "Protocol",
|
|
19
|
+
"Reconnect interval (sec)": "Reconnect interval (sec)",
|
|
20
|
+
"This IP is unreachable from %s": "This IP is unreachable from %s",
|
|
21
|
+
"Use https": "Use https",
|
|
22
|
+
"Username": "Username"
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Adapter Address": "Dirección del adaptador",
|
|
3
|
+
"Adapter Callback Address": "Dirección de devolución de llamada del adaptador",
|
|
4
|
+
"Adapter Port": "Puerto adaptador",
|
|
5
|
+
"Additional settings": "Ajustes adicionales",
|
|
6
|
+
"BIN-RPC does not work with HTTPS. HTTPS has been disabled.": "BIN-RPC no funciona con HTTPS. HTTPS ha sido desactivado.",
|
|
7
|
+
"Check communication interval (sec)": "Verificar el intervalo de comunicación (sec)",
|
|
8
|
+
"Daemon": "Demonio",
|
|
9
|
+
"Don't delete devices": "No elimine dispositivos al iniciar el adaptador",
|
|
10
|
+
"Force objects re-init": "Sincronizar objetos (una vez)",
|
|
11
|
+
"HomeMatic Address": "Dirección HomeMatic",
|
|
12
|
+
"HomeMatic Port": "Puerto HomeMatic",
|
|
13
|
+
"Homematic RPC adapter settings": "Configuración del adaptador Homematic RPC",
|
|
14
|
+
"Listen on all IPs": "Escuchar en todas las direcciones IP",
|
|
15
|
+
"Ok": "De acuerdo",
|
|
16
|
+
"Password": "Contraseña",
|
|
17
|
+
"Please specify callback address": "Por favor, especifique la dirección de devolución de llamada.",
|
|
18
|
+
"Protocol": "Protocolo",
|
|
19
|
+
"Reconnect interval (sec)": "Intervalo de reconexión (sec)",
|
|
20
|
+
"This IP is unreachable from %s": "Este IP es inalcanzable desde %s",
|
|
21
|
+
"Use https": "usar https",
|
|
22
|
+
"Username": "Nombre de usuario"
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Adapter Address": "Adresse de l'adaptateur",
|
|
3
|
+
"Adapter Callback Address": "Adresse de rappel de l'adaptateur",
|
|
4
|
+
"Adapter Port": "Port de l'adaptateur",
|
|
5
|
+
"Additional settings": "Paramètres additionnels",
|
|
6
|
+
"BIN-RPC does not work with HTTPS. HTTPS has been disabled.": "BIN-RPC ne fonctionne pas avec HTTPS. HTTPS a été désactivé.",
|
|
7
|
+
"Check communication interval (sec)": "Vérifier l'intervalle de communication (sec)",
|
|
8
|
+
"Daemon": "Démon",
|
|
9
|
+
"Don't delete devices": "Ne supprimez pas les périphériques au démarrage de l'adaptateur",
|
|
10
|
+
"Force objects re-init": "Synchroniser des objets (une fois)",
|
|
11
|
+
"HomeMatic Address": "Adresse de HomeMatic",
|
|
12
|
+
"HomeMatic Port": "AccueilMatic Port",
|
|
13
|
+
"Homematic RPC adapter settings": "Paramètres de l'adaptateur RPC homématique",
|
|
14
|
+
"Listen on all IPs": "Écoutez sur toutes les adresses IP",
|
|
15
|
+
"Ok": "D'accord",
|
|
16
|
+
"Password": "Mot de passe",
|
|
17
|
+
"Please specify callback address": "Veuillez spécifier l'adresse de rappel.",
|
|
18
|
+
"Protocol": "Protocole",
|
|
19
|
+
"Reconnect interval (sec)": "Intervalle de reconnexion (sec)",
|
|
20
|
+
"This IP is unreachable from %s": "Cette adresse IP est inaccessible depuis %s",
|
|
21
|
+
"Use https": "utiliser https",
|
|
22
|
+
"Username": "Nom d'utilisateur"
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Adapter Address": "Indirizzo dell'adattatore",
|
|
3
|
+
"Adapter Callback Address": "Indirizzo di richiamata dell'adattatore",
|
|
4
|
+
"Adapter Port": "Porta dell'adattatore",
|
|
5
|
+
"Additional settings": "Altre impostazioni",
|
|
6
|
+
"BIN-RPC does not work with HTTPS. HTTPS has been disabled.": "BIN-RPC non funziona con HTTPS. HTTPS è stato disabilitato.",
|
|
7
|
+
"Check communication interval (sec)": "Controllare l'intervallo di comunicazione (sec)",
|
|
8
|
+
"Daemon": "Demone",
|
|
9
|
+
"Don't delete devices": "Non eliminare i dispositivi all'avvio dell'adattatore",
|
|
10
|
+
"Force objects re-init": "Sincronizza oggetti (una volta)",
|
|
11
|
+
"HomeMatic Address": "Indirizzo HomeMatic",
|
|
12
|
+
"HomeMatic Port": "HomeMatic Port",
|
|
13
|
+
"Homematic RPC adapter settings": "Impostazioni dell'adattatore RPC Homematic",
|
|
14
|
+
"Listen on all IPs": "Ascolta su tutti gli IP",
|
|
15
|
+
"Ok": "Ok",
|
|
16
|
+
"Password": "Parola d'ordine",
|
|
17
|
+
"Please specify callback address": "Si prega di specificare l'indirizzo di richiamata.",
|
|
18
|
+
"Protocol": "Protocollo",
|
|
19
|
+
"Reconnect interval (sec)": "Intervallo di riconnessione (sec)",
|
|
20
|
+
"This IP is unreachable from %s": "Questo IP non è raggiungibile da %s",
|
|
21
|
+
"Use https": "usa https",
|
|
22
|
+
"Username": "Nome utente"
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Adapter Address": "Adapter adres",
|
|
3
|
+
"Adapter Callback Address": "Adapter-callback-adres",
|
|
4
|
+
"Adapter Port": "Adapterpoort",
|
|
5
|
+
"Additional settings": "Aanvullende instellingen",
|
|
6
|
+
"BIN-RPC does not work with HTTPS. HTTPS has been disabled.": "BIN-RPC werkt niet met HTTPS. HTTPS is uitgeschakeld.",
|
|
7
|
+
"Check communication interval (sec)": "Controleer communicatie-interval (sec)",
|
|
8
|
+
"Daemon": "Demon",
|
|
9
|
+
"Don't delete devices": "Verwijder geen apparaten bij het starten van de adapter",
|
|
10
|
+
"Force objects re-init": "Synchroniseer objecten (één keer)",
|
|
11
|
+
"HomeMatic Address": "HomeMatic-adres",
|
|
12
|
+
"HomeMatic Port": "HomeMatic-poort",
|
|
13
|
+
"Homematic RPC adapter settings": "Homematische RPC-adapterinstellingen",
|
|
14
|
+
"Listen on all IPs": "Luister op alle IP's",
|
|
15
|
+
"Ok": "OK",
|
|
16
|
+
"Password": "Wachtwoord",
|
|
17
|
+
"Please specify callback address": "Geef het callback-adres op.",
|
|
18
|
+
"Protocol": "Protocol",
|
|
19
|
+
"Reconnect interval (sec)": "Verbindingsinterval opnieuw verbinden (sec)",
|
|
20
|
+
"This IP is unreachable from %s": "Deze IP is onbereikbaar van %s",
|
|
21
|
+
"Use https": "gebruik https",
|
|
22
|
+
"Username": "Gebruikersnaam"
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Adapter Address": "Adres adaptera",
|
|
3
|
+
"Adapter Callback Address": "Adres zwrotny adaptera",
|
|
4
|
+
"Adapter Port": "Port adaptera",
|
|
5
|
+
"Additional settings": "Dodatkowe ustawienia",
|
|
6
|
+
"BIN-RPC does not work with HTTPS. HTTPS has been disabled.": "BIN-RPC nie działa z HTTPS. HTTPS został wyłączony.",
|
|
7
|
+
"Check communication interval (sec)": "Sprawdź interwał komunikacji (s)",
|
|
8
|
+
"Daemon": "Daemon",
|
|
9
|
+
"Don't delete devices": "Nie usuwaj urządzeń przy uruchamianiu adaptera",
|
|
10
|
+
"Force objects re-init": "Synchronizuj obiekty (raz)",
|
|
11
|
+
"HomeMatic Address": "Adres HomeMatic",
|
|
12
|
+
"HomeMatic Port": "Port HomeMatic",
|
|
13
|
+
"Homematic RPC adapter settings": "Homematyczne ustawienia adaptera RPC",
|
|
14
|
+
"Listen on all IPs": "Posłuchaj na wszystkich IP",
|
|
15
|
+
"Ok": "Ok",
|
|
16
|
+
"Password": "Hasło",
|
|
17
|
+
"Please specify callback address": "Proszę podać adres zwrotny.",
|
|
18
|
+
"Protocol": "Protokół",
|
|
19
|
+
"Reconnect interval (sec)": "Interwał ponownego połączenia (s)",
|
|
20
|
+
"This IP is unreachable from %s": "To IP jest nieosiągalne z %s",
|
|
21
|
+
"Use https": "użyj https",
|
|
22
|
+
"Username": "Nazwa Użytkownika"
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Adapter Address": "Endereço do adaptador",
|
|
3
|
+
"Adapter Callback Address": "Endereço de retorno de chamada do adaptador",
|
|
4
|
+
"Adapter Port": "Porta adaptadora",
|
|
5
|
+
"Additional settings": "Configurações adicionais",
|
|
6
|
+
"BIN-RPC does not work with HTTPS. HTTPS has been disabled.": "O BIN-RPC não funciona com HTTPS. HTTPS foi desativado.",
|
|
7
|
+
"Check communication interval (sec)": "Verifique o intervalo de comunicação (seg)",
|
|
8
|
+
"Daemon": "Daemon",
|
|
9
|
+
"Don't delete devices": "Não exclua dispositivos na inicialização do adaptador",
|
|
10
|
+
"Force objects re-init": "Sincronizar objetos (uma vez)",
|
|
11
|
+
"HomeMatic Address": "Endereço HomeMatic",
|
|
12
|
+
"HomeMatic Port": "HomeMatic Port",
|
|
13
|
+
"Homematic RPC adapter settings": "Configurações do adaptador Homematic RPC",
|
|
14
|
+
"Listen on all IPs": "Ouça em todos os IPs",
|
|
15
|
+
"Ok": "Ok",
|
|
16
|
+
"Password": "Senha",
|
|
17
|
+
"Please specify callback address": "Por favor, especifique o endereço de retorno de chamada.",
|
|
18
|
+
"Protocol": "Protocolo",
|
|
19
|
+
"Reconnect interval (sec)": "Intervalo de Reconexão (segundo)",
|
|
20
|
+
"This IP is unreachable from %s": "Este IP é inacessível de %s",
|
|
21
|
+
"Use https": "use https",
|
|
22
|
+
"Username": "Username"
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Adapter Address": "Собственный адрес",
|
|
3
|
+
"Adapter Callback Address": "Собственный Callback адрес",
|
|
4
|
+
"Adapter Port": "Порт драйвера ioBroker",
|
|
5
|
+
"Additional settings": "Дополнительные настройки",
|
|
6
|
+
"BIN-RPC does not work with HTTPS. HTTPS has been disabled.": "BIN-RPC не работает с HTTPS. HTTPS отключен.",
|
|
7
|
+
"Check communication interval (sec)": "Интервал проверки соединения(сек)",
|
|
8
|
+
"Daemon": "Служба",
|
|
9
|
+
"Don't delete devices": "Не удаляйте устройства при старте адаптера",
|
|
10
|
+
"Force objects re-init": "Синхронизировать объекты (один раз)",
|
|
11
|
+
"HomeMatic Address": "Адрес HomeMatic",
|
|
12
|
+
"HomeMatic Port": "Порт HomeMatic",
|
|
13
|
+
"Homematic RPC adapter settings": "Настройки Homematic RPC драйвера",
|
|
14
|
+
"Listen on all IPs": "Слушать на всех IP адресах",
|
|
15
|
+
"Ok": "Ok",
|
|
16
|
+
"Password": "пароль",
|
|
17
|
+
"Please specify callback address": "Введите IP адрес для callback.",
|
|
18
|
+
"Protocol": "Протокол",
|
|
19
|
+
"Reconnect interval (sec)": "Интервал повтора соединения(сек)",
|
|
20
|
+
"This IP is unreachable from %s": "Этот IP не доступен для %s",
|
|
21
|
+
"Use https": "использовать https",
|
|
22
|
+
"Username": "имя пользователя"
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Adapter Address": "适配器地址",
|
|
3
|
+
"Adapter Callback Address": "适配器回调地址",
|
|
4
|
+
"Adapter Port": "适配器端口",
|
|
5
|
+
"Additional settings": "其他设置",
|
|
6
|
+
"BIN-RPC does not work with HTTPS. HTTPS has been disabled.": "BIN-RPC不适用于HTTPS。 HTTPS已被禁用。",
|
|
7
|
+
"Check communication interval (sec)": "检查通信间隔(秒)",
|
|
8
|
+
"Daemon": "守护进程",
|
|
9
|
+
"Don't delete devices": "不要在适配器启动时删除设备",
|
|
10
|
+
"Force objects re-init": "同步对象(一次)",
|
|
11
|
+
"HomeMatic Address": "HomeMatic地址",
|
|
12
|
+
"HomeMatic Port": "HomeMatic港口",
|
|
13
|
+
"Homematic RPC adapter settings": "Homematic RPC适配器设置",
|
|
14
|
+
"Listen on all IPs": "收听所有IP",
|
|
15
|
+
"Ok": "好",
|
|
16
|
+
"Password": "密码",
|
|
17
|
+
"Please specify callback address": "请指定回拨地址。",
|
|
18
|
+
"Protocol": "协议",
|
|
19
|
+
"Reconnect interval (sec)": "重新连接间隔(秒)",
|
|
20
|
+
"This IP is unreachable from %s": "此IP无法从%s访问 %s",
|
|
21
|
+
"Use https": "使用https",
|
|
22
|
+
"Username": "用户名"
|
|
23
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const { exec } = require('child_process');
|
|
3
|
+
const { platform } = require('os');
|
|
4
|
+
|
|
5
|
+
const files = fs.readdirSync(__dirname).filter(n => n.endsWith('.png'));
|
|
6
|
+
const os = platform();
|
|
7
|
+
|
|
8
|
+
// only linux windows supported
|
|
9
|
+
if (!os.startsWith('win') && os !== 'linux') {
|
|
10
|
+
throw new Error(`Unsupported operating system: ${os}`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function getSize(name) {
|
|
14
|
+
return new Promise(resolve => {
|
|
15
|
+
exec(`${os.startsWith('win') ? 'imageMagic\\identify' : 'identify'} -ping -format %[fx:w]x%[fx:h] ${name}`, (error, stdout) => {
|
|
16
|
+
const [x,y] = stdout.split('x');
|
|
17
|
+
resolve({x: x - 1, y: y - 1});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async function buildLines() {
|
|
23
|
+
const lines = [];
|
|
24
|
+
for (let n = 0; n < files.length; n++) {
|
|
25
|
+
const name = files[n];
|
|
26
|
+
console.log(`${n + 1} / ${files.length}`);
|
|
27
|
+
const size = await getSize(name);
|
|
28
|
+
if (os.startsWith('win')) {
|
|
29
|
+
lines.push(`imageMagic\\magick ${name} -fill none -draw "alpha 0,0 floodfill" -draw "alpha ${size.x},${size.y} floodfill" -draw "alpha 0,${size.y} floodfill" -draw "alpha ${size.x},0 floodfill" -channel alpha -blur 0x2 result\\${name}`);
|
|
30
|
+
lines.push(`imageMagic\\magick.exe result\\${name} -brightness-contrast 0x10 result\\${name}`);
|
|
31
|
+
} else {
|
|
32
|
+
lines.push(`convert ${name} -fill none -draw "matte 0,0 floodfill" -draw "matte ${size.x},${size.y} floodfill" -draw "matte 0,${size.y} floodfill" -draw "matte ${size.x},0 floodfill" -channel alpha -blur 0x2 result/${name}`);
|
|
33
|
+
lines.push(`convert result/${name} -brightness-contrast 0x10 result/${name}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (os.startsWith('win')) {
|
|
38
|
+
fs.writeFileSync(`${__dirname}\\remove.bat`, lines.join('\n'));
|
|
39
|
+
} else {
|
|
40
|
+
fs.writeFileSync(`${__dirname}/remove.sh`, 'mkdir result\n' + lines.join('\n'));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
buildLines();
|
package/admin/words.js
CHANGED
|
@@ -15,7 +15,7 @@ systemDictionary = {
|
|
|
15
15
|
"HomeMatic Port": { "en": "HomeMatic Port", "de": "HomeMatic Port", "ru": "Порт HomeMatic", "pt": "HomeMatic Port", "nl": "HomeMatic-poort", "fr": "AccueilMatic Port", "it": "HomeMatic Port", "es": "Puerto HomeMatic", "pl": "Port HomeMatic", "zh-cn": "HomeMatic港口"},
|
|
16
16
|
"Homematic RPC adapter settings": { "en": "Homematic RPC adapter settings", "de": "Homematic RPC Adapter Einstellungen", "ru": "Настройки Homematic RPC драйвера", "pt": "Configurações do adaptador Homematic RPC", "nl": "Homematische RPC-adapterinstellingen", "fr": "Paramètres de l'adaptateur RPC homématique", "it": "Impostazioni dell'adattatore RPC Homematic", "es": "Configuración del adaptador Homematic RPC", "pl": "Homematyczne ustawienia adaptera RPC", "zh-cn": "Homematic RPC适配器设置"},
|
|
17
17
|
"Listen on all IPs": { "en": "Listen on all IPs", "de": "Anfragen für alle IPs beantworten", "ru": "Слушать на всех IP адресах", "pt": "Ouça em todos os IPs", "nl": "Luister op alle IP's", "fr": "Écoutez sur toutes les adresses IP", "it": "Ascolta su tutti gli IP", "es": "Escuchar en todas las direcciones IP", "pl": "Posłuchaj na wszystkich IP", "zh-cn": "收听所有IP"},
|
|
18
|
-
"Ok": { "en": "Ok", "de": "Ok", "ru": "Ok", "pt": "
|
|
18
|
+
"Ok": { "en": "Ok", "de": "Ok", "ru": "Ok", "pt": "Ok", "nl": "OK", "fr": "D'accord", "it": "Ok", "es": "De acuerdo", "pl": "Ok", "zh-cn": "好"},
|
|
19
19
|
"Password": { "en": "Password", "de": "Passwort", "ru": "пароль", "pt": "Senha", "nl": "Wachtwoord", "fr": "Mot de passe", "it": "Parola d'ordine", "es": "Contraseña", "pl": "Hasło", "zh-cn": "密码"},
|
|
20
20
|
"Please specify callback address": { "en": "Please specify callback address.", "de": "Bitte Callback IP-Adresse eingeben.", "ru": "Введите IP адрес для callback.", "pt": "Por favor, especifique o endereço de retorno de chamada.", "nl": "Geef het callback-adres op.", "fr": "Veuillez spécifier l'adresse de rappel.", "it": "Si prega di specificare l'indirizzo di richiamata.", "es": "Por favor, especifique la dirección de devolución de llamada.", "pl": "Proszę podać adres zwrotny.", "zh-cn": "请指定回拨地址。"},
|
|
21
21
|
"Protocol": { "en": "Protocol", "de": "Protokoll", "ru": "Протокол", "pt": "Protocolo", "nl": "Protocol", "fr": "Protocole", "it": "Protocollo", "es": "Protocolo", "pl": "Protokół", "zh-cn": "协议"},
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests whether the given variable is really an Array
|
|
3
|
+
* @param {any} it The variable to test
|
|
4
|
+
* @returns {it is any[]}
|
|
5
|
+
*/
|
|
6
|
+
export function isArray(it: any): it is any[];
|
|
7
|
+
/**
|
|
8
|
+
* Tests whether the given variable is a real object and not an Array
|
|
9
|
+
* @param {any} it The variable to test
|
|
10
|
+
* @returns {it is Record<string, any>}
|
|
11
|
+
*/
|
|
12
|
+
export function isObject(it: any): it is Record<string, any>;
|
|
13
|
+
/**
|
|
14
|
+
* Translates text to the target language. Automatically chooses the right translation API.
|
|
15
|
+
* @param {string} text The text to translate
|
|
16
|
+
* @param {string} targetLang The target languate
|
|
17
|
+
* @param {string} [yandexApiKey] The yandex API key. You can create one for free at https://translate.yandex.com/developers
|
|
18
|
+
* @returns {Promise<string>}
|
|
19
|
+
*/
|
|
20
|
+
export function translateText(text: string, targetLang: string, yandexApiKey?: string | undefined): Promise<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
const axios = require('axios').default;
|
|
2
|
-
|
|
3
3
|
/**
|
|
4
4
|
* Tests whether the given variable is a real object and not an Array
|
|
5
5
|
* @param {any} it The variable to test
|
|
@@ -12,17 +12,17 @@ function isObject(it) {
|
|
|
12
12
|
// [] instanceof Object === true
|
|
13
13
|
return Object.prototype.toString.call(it) === '[object Object]';
|
|
14
14
|
}
|
|
15
|
-
|
|
16
15
|
/**
|
|
17
16
|
* Tests whether the given variable is really an Array
|
|
18
17
|
* @param {any} it The variable to test
|
|
19
18
|
* @returns {it is any[]}
|
|
20
19
|
*/
|
|
21
20
|
function isArray(it) {
|
|
22
|
-
if (typeof Array.isArray === 'function')
|
|
21
|
+
if (typeof Array.isArray === 'function') {
|
|
22
|
+
return Array.isArray(it);
|
|
23
|
+
}
|
|
23
24
|
return Object.prototype.toString.call(it) === '[object Array]';
|
|
24
25
|
}
|
|
25
|
-
|
|
26
26
|
/**
|
|
27
27
|
* Translates text to the target language. Automatically chooses the right translation API.
|
|
28
28
|
* @param {string} text The text to translate
|
|
@@ -30,19 +30,20 @@ function isArray(it) {
|
|
|
30
30
|
* @param {string} [yandexApiKey] The yandex API key. You can create one for free at https://translate.yandex.com/developers
|
|
31
31
|
* @returns {Promise<string>}
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
function translateText(text, targetLang, yandexApiKey) {
|
|
34
34
|
if (targetLang === 'en') {
|
|
35
35
|
return text;
|
|
36
|
-
}
|
|
36
|
+
}
|
|
37
|
+
else if (!text) {
|
|
37
38
|
return '';
|
|
38
39
|
}
|
|
39
40
|
if (yandexApiKey) {
|
|
40
41
|
return translateYandex(text, targetLang, yandexApiKey);
|
|
41
|
-
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
42
44
|
return translateGoogle(text, targetLang);
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
|
-
|
|
46
47
|
/**
|
|
47
48
|
* Translates text with Yandex API
|
|
48
49
|
* @param {string} text The text to translate
|
|
@@ -56,16 +57,16 @@ async function translateYandex(text, targetLang, apiKey) {
|
|
|
56
57
|
}
|
|
57
58
|
try {
|
|
58
59
|
const url = `https://translate.yandex.net/api/v1.5/tr.json/translate?key=${apiKey}&text=${encodeURIComponent(text)}&lang=en-${targetLang}`;
|
|
59
|
-
const response = await axios({url, timeout: 15000});
|
|
60
|
+
const response = await axios({ url, timeout: 15000 });
|
|
60
61
|
if (response.data && response.data.text && isArray(response.data.text)) {
|
|
61
62
|
return response.data.text[0];
|
|
62
63
|
}
|
|
63
64
|
throw new Error('Invalid response for translate request');
|
|
64
|
-
}
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
65
67
|
throw new Error(`Could not translate to "${targetLang}": ${e}`);
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
|
-
|
|
69
70
|
/**
|
|
70
71
|
* Translates text with Google API
|
|
71
72
|
* @param {string} text The text to translate
|
|
@@ -75,25 +76,25 @@ async function translateYandex(text, targetLang, apiKey) {
|
|
|
75
76
|
async function translateGoogle(text, targetLang) {
|
|
76
77
|
try {
|
|
77
78
|
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`;
|
|
78
|
-
const response = await axios({url, timeout: 15000});
|
|
79
|
+
const response = await axios({ url, timeout: 15000 });
|
|
79
80
|
if (isArray(response.data)) {
|
|
80
81
|
// we got a valid response
|
|
81
82
|
return response.data[0][0][0];
|
|
82
83
|
}
|
|
83
84
|
throw new Error('Invalid response for translate request');
|
|
84
|
-
}
|
|
85
|
+
}
|
|
86
|
+
catch (e) {
|
|
85
87
|
if (e.response && e.response.status === 429) {
|
|
86
|
-
throw new Error(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} else {
|
|
88
|
+
throw new Error(`Could not translate to "${targetLang}": Rate-limited by Google Translate`);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
90
91
|
throw new Error(`Could not translate to "${targetLang}": ${e}`);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
|
-
|
|
95
95
|
module.exports = {
|
|
96
96
|
isArray,
|
|
97
97
|
isObject,
|
|
98
98
|
translateText
|
|
99
99
|
};
|
|
100
|
+
//# sourceMappingURL=gulptools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gulptools.js","sourceRoot":"","sources":["../../src/lib/gulptools.js"],"names":[],"mappings":"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"}
|