Skip to content

Commit

Permalink
Resolve "Add to latest" tasks (#21)
Browse files Browse the repository at this point in the history
* feat: add axios timeout

* refactor: use timeout in seconds and rename to updateIntervall

* refactor: switch to i18n translations

* refactor: limit configurable timeout
  • Loading branch information
theknut committed Apr 11, 2024
1 parent 521e392 commit 4932be8
Show file tree
Hide file tree
Showing 27 changed files with 266 additions and 226 deletions.
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -49,7 +49,7 @@ Check your router to find out the IP address of the heat pump and enable static
| IP address | IP address of the heat pump (see [Connection to heat pump](#Connection-to-heat-pump)) |
| Username | Default `waterkotte` |
| Password | Default `waterkotte` |
| Update interval | Frequency of updating the values in milliseconds (Default: 300000 ms = 5 m) |
| Update interval | Frequency of updating the values in milliseconds (Default: 300 seconds = 5 minutes) |
| Remove whitespace from state ID | If `State format` is `Path + Description` all whitespaces will be replaced by `_` |

#### State format
Expand All @@ -66,7 +66,11 @@ Check your router to find out the IP address of the heat pump and enable static
<!--
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
- (theknut) change update interval from milliseconds to seconds
- (theknut) add axios timeout
- (theknut) remove unused onStateChange handler
-->

### 0.0.2 (2024-03-11)

- (theknut) prepare for release
Expand Down
14 changes: 12 additions & 2 deletions admin/i18n/de/translations.json
@@ -1,5 +1,15 @@
{
"waterkotte-easycon adapter settings": "Adaptereinstellungen für waterkotte-easycon",
"credentialsHelp": "Verwenden Sie „Waterkotte“, falls unbekannt",
"ipAddress": "IP Adresse",
"option1": "Option 1",
"option2": "Option 2"
"option2": "Option 2",
"password": "Passwort",
"pathFlavor": "Statusformat",
"pathFlavorHelp": "Wählen Sie aus, wie die Status-IDs formatiert werden sollen",
"removeWhitespace": "Entfernen Sie Leerzeichen aus den Status-IDs",
"updateInterval": "Updateintervall",
"updateIntervalHelp": "In Sekunden (Standard = 300 Sekunden = 5 Minuten)",
"updateIntervalValidator": "Muss > 20 und < 86400 sein",
"username": "Nutzername",
"waterkotte-easycon adapter settings": "Adaptereinstellungen für Waterkotte-Easycon"
}
14 changes: 12 additions & 2 deletions admin/i18n/en/translations.json
@@ -1,5 +1,15 @@
{
"waterkotte-easycon adapter settings": "Adapter settings for waterkotte-easycon",
"credentialsHelp": "Use 'waterkotte' if unknown",
"ipAddress": "IP address",
"option1": "option1",
"option2": "option2"
"option2": "option2",
"password": "Password",
"pathFlavor": "State format",
"pathFlavorHelp": "Select how the state id's should be formatted",
"removeWhitespace": "Remove space from state id's",
"updateInterval": "Update interval",
"updateIntervalHelp": "In seconds (default = 300 seconds = 5 minutes)",
"updateIntervalValidator": "Must be > 20 and < 86400",
"username": "Username",
"waterkotte-easycon adapter settings": "Adapter settings for waterkotte-easycon"
}
14 changes: 12 additions & 2 deletions admin/i18n/es/translations.json
@@ -1,5 +1,15 @@
{
"waterkotte-easycon adapter settings": "Ajustes del adaptador para waterkotte-easycon",
"credentialsHelp": "Utilice 'waterkotte' si se desconoce",
"ipAddress": "dirección IP",
"option1": "Opción 1",
"option2": "opcion 2"
"option2": "opcion 2",
"password": "Contraseña",
"pathFlavor": "Formato de estado",
"pathFlavorHelp": "Seleccione cómo se deben formatear las identificaciones estatales",
"removeWhitespace": "Eliminar espacio de las identificaciones estatales",
"updateInterval": "Intervalo de actualización",
"updateIntervalHelp": "En segundos (predeterminado = 300 segundos = 5 minutos)",
"updateIntervalValidator": "Debe ser > 20 y < 86400",
"username": "Nombre de usuario",
"waterkotte-easycon adapter settings": "Configuración del adaptador para waterkotte-easycon"
}
14 changes: 12 additions & 2 deletions admin/i18n/fr/translations.json
@@ -1,5 +1,15 @@
{
"waterkotte-easycon adapter settings": "Paramètres d'adaptateur pour waterkotte-easycon",
"credentialsHelp": "Utilisez 'waterkotte' si inconnu",
"ipAddress": "adresse IP",
"option1": "Option 1",
"option2": "Option 2"
"option2": "Option 2",
"password": "Mot de passe",
"pathFlavor": "Format d'état",
"pathFlavorHelp": "Sélectionnez comment les identifiants d'état doivent être formatés",
"removeWhitespace": "Supprimer l'espace des identifiants d'état",
"updateInterval": "Intervalle de mise à jour",
"updateIntervalHelp": "En secondes (par défaut = 300 secondes = 5 minutes)",
"updateIntervalValidator": "Doit être > 20 et < 86 400",
"username": "Nom d'utilisateur",
"waterkotte-easycon adapter settings": "Paramètres de l'adaptateur pour waterkotte-easycon"
}
14 changes: 12 additions & 2 deletions admin/i18n/it/translations.json
@@ -1,5 +1,15 @@
{
"waterkotte-easycon adapter settings": "Impostazioni dell'adattatore per waterkotte-easycon",
"credentialsHelp": "Usa 'waterkotte' se sconosciuto",
"ipAddress": "indirizzo IP",
"option1": "opzione 1",
"option2": "opzione 2"
"option2": "opzione 2",
"password": "Parola d'ordine",
"pathFlavor": "Formato stato",
"pathFlavorHelp": "Seleziona la modalità di formattazione degli ID di stato",
"removeWhitespace": "Rimuovi lo spazio dagli ID di stato",
"updateInterval": "Intervallo di aggiornamento",
"updateIntervalHelp": "In secondi (predefinito = 300 secondi = 5 minuti)",
"updateIntervalValidator": "Deve essere > 20 e < 86400",
"username": "Nome utente",
"waterkotte-easycon adapter settings": "Impostazioni dell'adattatore per waterkotte-easycon"
}
14 changes: 12 additions & 2 deletions admin/i18n/nl/translations.json
@@ -1,5 +1,15 @@
{
"waterkotte-easycon adapter settings": "Adapterinstellingen voor waterkotte-easycon",
"credentialsHelp": "Gebruik 'waterkotte' indien onbekend",
"ipAddress": "IP adres",
"option1": "Optie 1",
"option2": "Optie 2"
"option2": "Optie 2",
"password": "Wachtwoord",
"pathFlavor": "Staat formaat",
"pathFlavorHelp": "Selecteer hoe de status-ID's moeten worden opgemaakt",
"removeWhitespace": "Verwijder spatie uit status-ID's",
"updateInterval": "Bijwerkingsonderbreking",
"updateIntervalHelp": "In seconden (standaard = 300 seconden = 5 minuten)",
"updateIntervalValidator": "Moet > 20 en < 86400 zijn",
"username": "Gebruikersnaam",
"waterkotte-easycon adapter settings": "Adapterinstellingen voor waterkotte-easycon"
}
14 changes: 12 additions & 2 deletions admin/i18n/pl/translations.json
@@ -1,5 +1,15 @@
{
"waterkotte-easycon adapter settings": "Ustawienia adaptera dla waterkotte-easycon",
"credentialsHelp": "Jeśli nie jest znane, użyj słowa „waterkotte”.",
"ipAddress": "adres IP",
"option1": "opcja 1",
"option2": "Opcja 2"
"option2": "Opcja 2",
"password": "Hasło",
"pathFlavor": "Format stanu",
"pathFlavorHelp": "Wybierz sposób formatowania identyfikatora stanu",
"removeWhitespace": "Usuń spację z identyfikatorów stanu",
"updateInterval": "Interwał aktualizacji",
"updateIntervalHelp": "W sekundach (domyślnie = 300 sekund = 5 minut)",
"updateIntervalValidator": "Musi wynosić > 20 i < 86400",
"username": "Nazwa użytkownika",
"waterkotte-easycon adapter settings": "Ustawienia adaptera dla waterkotte-easycon"
}
14 changes: 12 additions & 2 deletions admin/i18n/pt/translations.json
@@ -1,5 +1,15 @@
{
"waterkotte-easycon adapter settings": "Configurações do adaptador para waterkotte-easycon",
"credentialsHelp": "Use 'waterkotte' se desconhecido",
"ipAddress": "endereço de IP",
"option1": "Opção 1",
"option2": "opção 2"
"option2": "opção 2",
"password": "Senha",
"pathFlavor": "Formato de estado",
"pathFlavorHelp": "Selecione como os IDs de estado devem ser formatados",
"removeWhitespace": "Remover espaço dos IDs de estado",
"updateInterval": "Intervalo de atualização",
"updateIntervalHelp": "Em segundos (padrão = 300 segundos = 5 minutos)",
"updateIntervalValidator": "Deve ser > 20 e < 86400",
"username": "Nome de usuário",
"waterkotte-easycon adapter settings": "Configurações do adaptador para waterkotte-easycon"
}
14 changes: 12 additions & 2 deletions admin/i18n/ru/translations.json
@@ -1,5 +1,15 @@
{
"waterkotte-easycon adapter settings": "Настройки адаптера для waterkotte-easycon",
"credentialsHelp": "Если неизвестно, используйте слово «waterkotte».",
"ipAddress": "айпи адрес",
"option1": "Опция 1",
"option2": "вариант 2"
"option2": "вариант 2",
"password": "Пароль",
"pathFlavor": "Государственный формат",
"pathFlavorHelp": "Выберите способ форматирования идентификаторов штата.",
"removeWhitespace": "Удалить пробел из идентификатора состояния",
"updateInterval": "Интервал обновления",
"updateIntervalHelp": "В секундах (по умолчанию = 300 секунд = 5 минут)",
"updateIntervalValidator": "Должно быть > 20 и < 86400",
"username": "Имя пользователя",
"waterkotte-easycon adapter settings": "Настройки адаптера для Waterkotte-easycon"
}
14 changes: 12 additions & 2 deletions admin/i18n/uk/translations.json
@@ -1,5 +1,15 @@
{
"waterkotte-easycon adapter settings": "Налаштування адаптера для waterkotte-easycon",
"credentialsHelp": "Використовуйте \"waterkotte\", якщо невідомо",
"ipAddress": "IP-адреса",
"option1": "варіант1",
"option2": "варіант2"
"option2": "варіант2",
"password": "Пароль",
"pathFlavor": "Державний формат",
"pathFlavorHelp": "Виберіть, як має бути відформатований ідентифікатор стану",
"removeWhitespace": "Видалити пробіл із ідентифікаторів станів",
"updateInterval": "Інтервал оновлення",
"updateIntervalHelp": "У секундах (за замовчуванням = 300 секунд = 5 хвилин)",
"updateIntervalValidator": "Має бути > 20 і < 86400",
"username": "Ім'я користувача",
"waterkotte-easycon adapter settings": "Налаштування адаптера для waterkotte-easycon"
}
14 changes: 12 additions & 2 deletions admin/i18n/zh-cn/translations.json
@@ -1,5 +1,15 @@
{
"waterkotte-easycon adapter settings": "waterkotte-easycon的适配器设置",
"credentialsHelp": "如果未知,请使用“waterkotte”",
"ipAddress": "IP地址",
"option1": "选项1",
"option2": "选项2"
"option2": "选项2",
"password": "密码",
"pathFlavor": "状态格式",
"pathFlavorHelp": "选择州 ID 的格式",
"removeWhitespace": "删除状态 ID 中的空格",
"updateInterval": "更新间隔",
"updateIntervalHelp": "以秒为单位(默认 = 300 秒 = 5 分钟)",
"updateIntervalValidator": "必须 > 20 且 < 86400",
"username": "用户名",
"waterkotte-easycon adapter settings": "Waterkotte-easycon 的适配器设置"
}
138 changes: 15 additions & 123 deletions admin/jsonConfig.json
Expand Up @@ -11,111 +11,30 @@
},
"ipAddress": {
"type": "text",
"label": {
"en": "Ip address",
"de": "IP-Adresse",
"ru": "Ip адрес",
"pt": "Endereço Ip",
"nl": "Ip adres",
"fr": "Adresse IP",
"it": "Indirizzo Ip",
"es": "Dirección de identificación",
"pl": "Adres IP",
"uk": "Ip адреса",
"zh-cn": "叶子地址"
},
"label": "ipAddress",
"sm": 3,
"newLine": true
},
"username": {
"type": "text",
"label": {
"en": "Username",
"de": "Benutzername",
"ru": "Имя пользователя",
"pt": "Nome de utilizador",
"nl": "Gebruikersnaam",
"fr": "Nom d'utilisateur",
"it": "Nome utente",
"es": "Nombre de usuario",
"pl": "Nazwa użytkownika",
"uk": "Ім'я користувача",
"zh-cn": "用户名"
},
"help": {
"en": "Use 'waterkotte' if unknown",
"de": "Verwenden Sie 'waterkotte', wenn unbekannt",
"ru": "Используйте 'waterkotte', если неизвестно",
"pt": "Use 'waterkotte' se desconhecido",
"nl": "Gebruik 'waterkotte' indien onbekend",
"fr": "Utiliser 'waterkotte' si inconnu",
"it": "Utilizzare 'waterkotte' se sconosciuto",
"es": "Use 'waterkotte' si se desconoce",
"pl": "Użyj 'waterkotte', jeśli jest nieznany",
"uk": "Використовуйте 'waterkotte' якщо невідомо",
"zh-cn": "如果未知, 请使用“ waterkotte ”"
},
"label": "username",
"help": "usernameHelp",
"sm": 3
},
"password": {
"type": "password",
"help": {
"en": "Use 'waterkotte' if unknown",
"de": "Verwenden Sie 'waterkotte', wenn unbekannt",
"ru": "Используйте 'waterkotte', если неизвестно",
"pt": "Use 'waterkotte' se desconhecido",
"nl": "Gebruik 'waterkotte' indien onbekend",
"fr": "Utiliser 'waterkotte' si inconnu",
"it": "Utilizzare 'waterkotte' se sconosciuto",
"es": "Use 'waterkotte' si se desconoce",
"pl": "Użyj 'waterkotte', jeśli jest nieznany",
"uk": "Використовуйте 'waterkotte' якщо невідомо",
"zh-cn": "如果未知, 请使用“ waterkotte ”"
},
"label": {
"en": "Password",
"de": "Passwort",
"ru": "Пароль",
"pt": "Senha",
"nl": "Wachtwoord",
"fr": "Mot de passe",
"it": "Password",
"es": "Contraseña",
"pl": "Hasło",
"uk": "Логін",
"zh-cn": "密码"
},
"help": "credentialsHelp",
"label": "password",
"sm": 3
},
"pollingInterval": {
"updateInterval": {
"type": "number",
"default": 300000,
"label": {
"en": "Update interval",
"de": "Update-Intervall",
"ru": "Интервал обновления",
"pt": "Intervalo de atualização",
"nl": "Bijwerken interval",
"fr": "Intervalle de mise à jour",
"it": "Intervallo di aggiornamento",
"es": "Intervalo de actualización",
"pl": "Przedział aktualizacji",
"uk": "Період оновлення",
"zh-cn": "更新间隔"
},
"help": {
"en": "In milliseconds (default = 300000 ms = 5 m)",
"de": "In Millisekunden (Standard = 300000 ms = 5 m)",
"ru": "В миллисекундах (по умолчанию = 30000 мс = 5 м)",
"pt": "Em milissegundos (padrão = 300000 ms = 5 m)",
"nl": "In milliseconden (standaard = 300000 ms = 5 m)",
"fr": "En millisecondes (par défaut = 300 000 ms = 5 m)",
"it": "In millisecondi (default = 300000 ms = 5 m)",
"es": "En milisegundos (por defecto = 300000 ms = 5 m)",
"pl": "W milisekundach (domyślnie = 300000 ms = 5 m)",
"uk": "У мілісекундах (default = 300000 мс = 5 м)",
"zh-cn": "毫秒( 默认 = 300 000 ms = 5 m)"
},
"default": 300,
"label": "updateInterval",
"help": "updateIntervalHelp",
"validator": "data.updateInterval > 20 && data.updateInterval < 86400",
"validatorErrorText": "updateIntervalValidator",
"validatorNoSaveOnError": true,
"sm": 3
},
"pathFlavor": {
Expand All @@ -125,42 +44,15 @@
{ "label": "Path + Name (e.g. 'Heating.Target value')", "value": 1 }
],
"default": 1,
"label": {
"en": "State format",
"de": "State Format"
},
"help": {
"en": "Select how the id should be formatted",
"de": "Wählen Sie aus, wie die Id formatiert werden soll",
"ru": "Выберите, как следует отформатировать id",
"pt": "Selecione como o id deve ser formatado",
"nl": "Selecteer hoe de id geformatteerd moet worden",
"fr": "Sélectionnez comment l'identifiant doit être formaté",
"it": "Selezionare come l'id dovrebbe essere formattato",
"es": "Seleccione cómo debe formatear el id",
"pl": "Wybierz sposób formatowania identyfikatora",
"uk": "Виберіть, як id слід відформатувати",
"zh-cn": "选择编号的格式"
},
"label": "pathFlavor",
"help": "pathFlavorHelp",
"sm": 6,
"newLine": true
},
"removeWhitespace": {
"type": "checkbox",
"default": true,
"label": {
"en": "Remove space from id",
"de": "Leerzeichen in der Id entfernen",
"ru": "Удалить пространство от id",
"pt": "Remover espaço de id",
"nl": "Spatie verwijderen uit id",
"fr": "Supprimer l'espace de l'id",
"it": "Rimuovere lo spazio da id",
"es": "Quitar espacio de id",
"pl": "Usuń miejsce z id",
"uk": "Видалити місце з id",
"zh-cn": "从 id 中删除空格"
},
"label": "removeWhitespace",
"sm": 6
}
}
Expand Down

0 comments on commit 4932be8

Please sign in to comment.