From 0853356077be1c5983139478d207e72b65c97151 Mon Sep 17 00:00:00 2001 From: pdbjjens Date: Mon, 22 Jan 2024 18:09:59 +0100 Subject: [PATCH] Use JSON config UI --- .npmignore | 2 +- .releaseconfig.json | 2 +- LICENSE | 2 +- README.md | 19 +- admin/i18n/de/translations.json | 50 ++-- admin/i18n/en/translations.json | 38 ++- admin/i18n/es/translations.json | 36 ++- admin/i18n/fr/translations.json | 50 ++-- admin/i18n/it/translations.json | 50 ++-- admin/i18n/nl/translations.json | 50 ++-- admin/i18n/pl/translations.json | 50 ++-- admin/i18n/pt/translations.json | 52 ++-- admin/i18n/ru/translations.json | 50 ++-- admin/i18n/uk/translations.json | 36 ++- admin/i18n/zh-cn/translations.json | 52 ++-- admin/jsonConfig.json | 103 ++++++++ io-package.json | 388 +++++++++++++++-------------- main.js | 235 ++++++++++++++--- package-lock.json | 13 + package.json | 2 +- test/unit.js | 7 - 21 files changed, 778 insertions(+), 509 deletions(-) create mode 100644 admin/jsonConfig.json delete mode 100644 test/unit.js diff --git a/.npmignore b/.npmignore index b92714ba..2ece08c9 100644 --- a/.npmignore +++ b/.npmignore @@ -27,7 +27,7 @@ iobroker.*.tgz package-lock.json # i18n intermediate files -admin/i18n +# admin/i18n # maintenance scripts maintenance/** \ No newline at end of file diff --git a/.releaseconfig.json b/.releaseconfig.json index da3cbe20..0e8a2b0a 100644 --- a/.releaseconfig.json +++ b/.releaseconfig.json @@ -1,3 +1,3 @@ { - "plugins": ["iobroker", "license"] + "plugins": ["iobroker", "license", "manual-review"] } \ No newline at end of file diff --git a/LICENSE b/LICENSE index 932132e2..b0326ff7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Jens-Peter Jensen jjensen@t-online.de +Copyright (c) 2024 Jens-Peter Jensen jjensen@t-online.de Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 07311378..7838f2ec 100644 --- a/README.md +++ b/README.md @@ -31,18 +31,18 @@ This adapter connects ioBroker to various VBus-based devices using resol-vbus, a * The default setting for the connection type is VBus/LAN, but it must be explicitly selected even for VBus/LAN, otherwise no connection will be established. * The correct settings for direct LAN access for VBus/LAN, DL3, DL2, KM2 are: - * Connection type: VBus/LAN or KM2 or DL2 or DL3 + * Connection type: VBus/LAN or KM2/DL2 or DL3/DL2Plus * Connection identifier: IP address (e.g. 192.168.178.188) or FullyQualifiedHostName (e.g. host1.example.com) * VBus password: YourVBusPassword (default: vbus) * Connection port: Default setting 7053 should not be changed - * DL3 channel: Only relevant for DL3 (values 1-6, channel 0 can not be read out) + * DL3 channel: Only relevant for DL3/DL2Plus (values 1-6, channel 0 can not be read out) * Update interval: Time between updates of the measured values (default 30s) * The correct settings for the DL3, DL2, KM2 access via VBus.net are: - * Connection type: DL3 or DL2 or KM2 + * Connection type: DL3/DL2Plus or DL2/KM2 * Connection identifier: vbus.net (or vbus.io) - both without http:// and Via identifier! * Connection port: Default setting 7053 should not be changed * VBus password: YourVBusPassword (default: vbus) - * DL3 channel: Only relevant for DL3 (values: 1-6, channel 0 cannot be read out) + * DL3 channel: Only relevant for DL3/DL2Plus (values: 1-6, channel 0 cannot be read out) * Via identifier: YourViaIdentifier (e.g. d1234567890) - without http:// before or .vbus.io behind * Update interval: Time between the update of the measured values (default 30s) @@ -51,6 +51,15 @@ This adapter connects ioBroker to various VBus-based devices using resol-vbus, a Placeholder for the next version (at the beginning of the line): ### **WORK IN PROGRESS** --> + +**WORK IN PROGRESS** + +* (pdbjjens) New: Support ioBroker discovery +* (pdbjjens) Change: node>=16, js-contoller>=4 and admin>=6 required +* (pdbjjens) New: Use JSON config UI +* (pdbjjens) Updated dependencies +* (pdbjjens) Fix: Set info.connection false when reconnecting + ### 0.2.5 (2023-03-14) * (pdbjjens) Updated dependencies @@ -89,7 +98,7 @@ The authors are in no way endorsed by or affiliated with RESOL GmbH, or any asso MIT License -Copyright (c) 2023 Jens-Peter Jensen +Copyright (c) 2024 Jens-Peter Jensen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/admin/i18n/de/translations.json b/admin/i18n/de/translations.json index 7220b4ed..34f5f4df 100644 --- a/admin/i18n/de/translations.json +++ b/admin/i18n/de/translations.json @@ -1,29 +1,27 @@ { - "Connection Device": "Verbindungsgerät", - "Connection Identifier": "Verbindungskennung", - "Connection Port": "Verbindungs-Port", - "DL2/KM2": "DL2 / KM2", - "DL3": "DL3", - "DL3 Channel": "DL3-Kanal", - "DL3 Channel 0": "DL3-Kanal 0", - "DL3 Channel 1": "DL3-Kanal 1", - "DL3 Channel 2": "DL3-Kanal 2", - "DL3 Channel 3": "DL3-Kanal 3", - "DL3 Channel 4": "DL3-Kanal 4", - "DL3 Channel 5": "DL3-Kanal 5", - "DL3 Channel 6": "DL3-Kanal 6", - "Default: 7053": "Standard: 7053", - "Default: vbus": "Standard: vbus", - "Force Adapter Reinitialization": "Reinitialisierung des Adapters erzwingen", - "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access": "Hostadresse (IP oder FQDN) für lokales LAN und für VBus.net oder serielle Port-ID für VBus/USB-Zugriff", - "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save": "Wenn Adapter Reinitialization gesetzt ist, wird der Adapter sofort nach dem Speichern mit einer neuen Konfiguration neu gestartet", - "Required for DL3 only": "Nur für DL3 erforderlich", - "Required only for VBus.net access via DLx/KMx": "Nur für den VBus.net-Zugriff über DLx / KMx erforderlich", - "Select VBus Connection Device Type": "Wählen Sie den VBus-Verbindungsgerätetyp (VBus/LAN, DL3 usw.).", - "Serial/LANGW": "Seriell/LANGW", - "VBus Interval": "VBus-Aktualisierungsintervall (in Sekunden)", - "VBus Password": "VBus Passwort", + "DL3 Channel 0": "DL3 Kanal 0", + "DL3 Channel 1": "DL3 Kanal 1", + "DL3 Channel 2": "DL3 Kanal 2", + "DL3 Channel 3": "DL3 Kanal 3", + "DL3 Channel 4": "DL3 Kanal 4", + "DL3 Channel 5": "DL3 Kanal 5", + "DL3 Channel 6": "DL3 Kanal 6", + "Desc_ConnectionDevice": "Gerät oder Dienst, mit dem Sie eine Verbindung zu Ihrem Resol-Controller herstellen.", + "Desc_ConnectionPort": "TCP-Verbindungsport Ihres Geräts – Standard: 7053", + "Desc_DL3Channel": "Nur für DL3 erforderlich – Belassen Sie es auf „Keine“, wenn Sie kein DL3 verwenden.", + "Desc_DeviceAddress": "Hostadresse (IP oder FQDN) Ihres Geräts in Ihrem LAN oder Port-ID Ihres seriellen/USB-Ports – leer, wenn vbus.net.", + "Desc_DevicePassword": "Passwort Ihres VBus-Geräts – Standard: vbus", + "Desc_Pollintervall": "Aktualisierungsintervall in Sekunden.", + "Desc_Via-tag": "Nur für VBus.net-Zugriff über KM2 / DLx erforderlich – z. B.: d01234567890.vbus.io", + "Lbl_ConnectionDevice": "Verbindungsgerät/Dienst", + "Lbl_ConnectionPort": "TCP-Verbindungsport", + "Lbl_DL3Channel": "DL3-Kanal", + "Lbl_DeviceAddress": "Geräteadresse", + "Lbl_DevicePassword": "Gerätepasswort", + "Lbl_Pollintervall": "Updateintervall", + "Lbl_Via-tag": "Via-Tag", + "Serial to LAN-Gateway": "Seriell zum LAN-Gateway", "VBus/LAN": "VBus/LAN", - "VBus/USB": "VBus/USB", - "Via tag": "Via-Kennung" + "none": "Keiner", + "Basic settings": "Grundeinstellungen" } diff --git a/admin/i18n/en/translations.json b/admin/i18n/en/translations.json index fed09077..1e046853 100644 --- a/admin/i18n/en/translations.json +++ b/admin/i18n/en/translations.json @@ -1,10 +1,4 @@ { - "Connection Device": "Connection Device", - "Connection Identifier": "Connection Identifier", - "Connection Port": "Connection Port", - "DL2/KM2": "DL2 / KM2", - "DL3": "DL3", - "DL3 Channel": "DL3 Channel", "DL3 Channel 0": "DL3 Channel 0", "DL3 Channel 1": "DL3 Channel 1", "DL3 Channel 2": "DL3 Channel 2", @@ -12,18 +6,22 @@ "DL3 Channel 4": "DL3 Channel 4", "DL3 Channel 5": "DL3 Channel 5", "DL3 Channel 6": "DL3 Channel 6", - "Default: 7053": "Default: 7053", - "Default: vbus": "Default: vbus", - "Force Adapter Reinitialization": "Force Adapter Reinitialization", - "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access": "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access", - "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save": "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save", - "Required for DL3 only": "Required for DL3 only", - "Required only for VBus.net access via DLx/KMx": "Required only for VBus.net access via DLx / KMx", - "Select VBus Connection Device Type": "Select VBus Connection Device Type (VBus/LAN, DL3 etc.)", - "Serial/LANGW": "Serial/LANGW", - "VBus Interval": "VBus Update Interval (in seconds)", - "VBus Password": "VBus Password", + "Desc_ConnectionDevice": "Device or service you are using to connect to your Resol controller.", + "Desc_ConnectionPort": "TCP Connection port of your device - Default: 7053", + "Desc_DL3Channel": "Required for DL3 only - Leave to none if you do not use a DL3.", + "Desc_DeviceAddress": "Host address (IP or FQDN) of your device in your LAN or Port-ID of your Serial/USB-Port - Empty if vbus.net.", + "Desc_DevicePassword": "Password of your VBus device - Default: vbus", + "Desc_Pollintervall": "Update interval in seconds.", + "Desc_Via-tag": "Required only for VBus.net access via KM2 / DLx - eg: d01234567890.vbus.io", + "Lbl_ConnectionDevice": "Connection Device / Service", + "Lbl_ConnectionPort": "TCP Connection Port", + "Lbl_DL3Channel": "DL3 Channel", + "Lbl_DeviceAddress": "Device Address", + "Lbl_DevicePassword": "Device Password", + "Lbl_Pollintervall": "Update Interval", + "Lbl_Via-tag": "Via-tag", + "Serial to LAN-Gateway": "Serial to LAN-Gateway", "VBus/LAN": "VBus/LAN", - "VBus/USB": "VBus/USB", - "Via tag": "Via tag" -} + "none": "None", + "Basic settings": "Basic settings" +} \ No newline at end of file diff --git a/admin/i18n/es/translations.json b/admin/i18n/es/translations.json index 36526968..039997ce 100644 --- a/admin/i18n/es/translations.json +++ b/admin/i18n/es/translations.json @@ -1,10 +1,4 @@ { - "Connection Device": "Dispositivo de conexión", - "Connection Identifier": "Identificador de conexión", - "Connection Port": "Puerto de conexión", - "DL2/KM2": "DL2 / KM2", - "DL3": "DL3", - "DL3 Channel": "Canal DL3", "DL3 Channel 0": "DL3 Canal 0", "DL3 Channel 1": "DL3 Canal 1", "DL3 Channel 2": "DL3 Canal 2", @@ -12,18 +6,22 @@ "DL3 Channel 4": "DL3 Canal 4", "DL3 Channel 5": "DL3 Canal 5", "DL3 Channel 6": "DL3 Canal 6", - "Default: 7053": "Predeterminado: 7053", - "Default: vbus": "Predeterminado: vbus", - "Force Adapter Reinitialization": "Reinicialización del adaptador de fuerza", - "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access": "Dirección de host (IP o FQDN) para LAN local y para VBus.net o Id. De puerto serie para acceso VBus/USB", - "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save": "Si se establece Forzar reinicialización del adaptador, el adaptador se reinicia con una nueva configuración inmediatamente al guardar", - "Required for DL3 only": "Requerido solo para DL3", - "Required only for VBus.net access via DLx/KMx": "Se requiere solo para el acceso a VBus.net a través de DLx / KMx", - "Select VBus Connection Device Type": "Seleccione el tipo de dispositivo de conexión VBus (VBus/LAN, DL3, etc.)", - "Serial/LANGW": "Serie/LANGW", - "VBus Interval": "Intervalo de actualización de VBus (en segundos)", - "VBus Password": "Contraseña de VBus", + "Desc_ConnectionDevice": "Dispositivo o servicio que estás utilizando para conectarte a tu controlador Resol.", + "Desc_ConnectionPort": "Puerto de conexión TCP de su dispositivo - Predeterminado: 7053", + "Desc_DL3Channel": "Requerido solo para DL3: déjelo en ninguno si no usa un DL3.", + "Desc_DeviceAddress": "Dirección de host (IP o FQDN) de su dispositivo en su LAN o ID de puerto de su puerto serie/USB: vacío si es vbus.net.", + "Desc_DevicePassword": "Contraseña de su dispositivo VBus - Predeterminada: vbus", + "Desc_Pollintervall": "Intervalo de actualización en segundos.", + "Desc_Via-tag": "Requerido solo para acceso a VBus.net a través de KM2 / DLx - por ejemplo: d01234567890.vbus.io", + "Lbl_ConnectionDevice": "Dispositivo/servicio de conexión", + "Lbl_ConnectionPort": "Puerto de conexión TCP", + "Lbl_DL3Channel": "Canal DL3", + "Lbl_DeviceAddress": "Dirección del dispositivo", + "Lbl_DevicePassword": "Contraseña del dispositivo", + "Lbl_Pollintervall": "Intervalo de actualización", + "Lbl_Via-tag": "Etiqueta vía", + "Serial to LAN-Gateway": "Serial a LAN-Gateway", "VBus/LAN": "VBus/LAN", - "VBus/USB": "VBus/USB", - "Via tag": "Vía etiqueta" + "none": "Ninguno", + "Basic settings": "Ajustes básicos" } diff --git a/admin/i18n/fr/translations.json b/admin/i18n/fr/translations.json index 78221c47..397348b6 100644 --- a/admin/i18n/fr/translations.json +++ b/admin/i18n/fr/translations.json @@ -1,29 +1,27 @@ { - "Connection Device": "Dispositif de connexion", - "Connection Identifier": "Identifiant de connexion", - "Connection Port": "Port de connexion", - "DL2/KM2": "DL2 / KM2", - "DL3": "DL3", - "DL3 Channel": "Canal DL3", - "DL3 Channel 0": "DL3 Channel 0", - "DL3 Channel 1": "DL3 Channel 1", - "DL3 Channel 2": "DL3 Channel 2", - "DL3 Channel 3": "DL3 Channel 3", - "DL3 Channel 4": "DL3 Channel 4", - "DL3 Channel 5": "DL3 Channel 5", - "DL3 Channel 6": "DL3 Channel 6", - "Default: 7053": "Par défaut: 7053", - "Default: vbus": "Par défaut: vbus", - "Force Adapter Reinitialization": "Forcer la réinitialisation de l'adaptateur", - "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access": "Adresse d'hôte (IP ou FQDN) pour le LAN local et pour VBus.net ou ID de port série pour l'accès VBus/USB", - "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save": "Si Forcer la réinitialisation de l'adaptateur est défini, l'adaptateur redémarre avec la nouvelle configuration immédiatement lors de l'enregistrement", - "Required for DL3 only": "Requis pour DL3 uniquement", - "Required only for VBus.net access via DLx/KMx": "Requis uniquement pour l'accès à VBus.net via DLx / KMx", - "Select VBus Connection Device Type": "Sélectionnez le type de périphérique de connexion VBus (VBus/LAN, DL3, etc.)", - "Serial/LANGW": "Série/LANGW", - "VBus Interval": "Intervalle de mise à jour VBus (en secondes)", - "VBus Password": "Mot de passe VBus", + "DL3 Channel 0": "DL3 Canal 0", + "DL3 Channel 1": "DL3 Canal 1", + "DL3 Channel 2": "DL3 Canal 2", + "DL3 Channel 3": "DL3 Canal 3", + "DL3 Channel 4": "DL3 Canal 4", + "DL3 Channel 5": "DL3 Canal 5", + "DL3 Channel 6": "DL3 Canal 6", + "Desc_ConnectionDevice": "Appareil ou service que vous utilisez pour vous connecter à votre contrôleur Resol.", + "Desc_ConnectionPort": "Port de connexion TCP de votre appareil - Par défaut : 7053", + "Desc_DL3Channel": "Obligatoire pour DL3 uniquement - Ne choisissez aucun si vous n'utilisez pas de DL3.", + "Desc_DeviceAddress": "Adresse hôte (IP ou FQDN) de votre appareil dans votre réseau local ou ID de port de votre port série/USB - Vide si vbus.net.", + "Desc_DevicePassword": "Mot de passe de votre appareil VBus - Par défaut : vbus", + "Desc_Pollintervall": "Intervalle de mise à jour en secondes.", + "Desc_Via-tag": "Requis uniquement pour l'accès à VBus.net via KM2 / DLx - par exemple : d01234567890.vbus.io", + "Lbl_ConnectionDevice": "Appareil de connexion/service", + "Lbl_ConnectionPort": "Port de connexion TCP", + "Lbl_DL3Channel": "Canal DL3", + "Lbl_DeviceAddress": "Adresse de l'appareil", + "Lbl_DevicePassword": "Mot de passe de l'appareil", + "Lbl_Pollintervall": "Intervalle de mise à jour", + "Lbl_Via-tag": "Via-tag", + "Serial to LAN-Gateway": "Passerelle série vers LAN", "VBus/LAN": "VBus/LAN", - "VBus/USB": "VBus/USB", - "Via tag": "Via tag" + "none": "Aucun", + "Basic settings": "Paramètres de base" } diff --git a/admin/i18n/it/translations.json b/admin/i18n/it/translations.json index 5b9d4036..3888d5ef 100644 --- a/admin/i18n/it/translations.json +++ b/admin/i18n/it/translations.json @@ -1,29 +1,27 @@ { - "Connection Device": "Dispositivo di connessione", - "Connection Identifier": "Identificatore di connessione", - "Connection Port": "Porta di connessione", - "DL2/KM2": "DL2 / KM2", - "DL3": "DL3", - "DL3 Channel": "Canale DL3", - "DL3 Channel 0": "Canale DL3 0", - "DL3 Channel 1": "Canale DL3 1", - "DL3 Channel 2": "Canale DL3 2", - "DL3 Channel 3": "Canale DL3 3", - "DL3 Channel 4": "Canale DL3 4", - "DL3 Channel 5": "Canale DL3 5", - "DL3 Channel 6": "Canale DL3 6", - "Default: 7053": "Predefinito: 7053", - "Default: vbus": "Predefinito: vbus", - "Force Adapter Reinitialization": "Reinizializzazione dell'adattatore di forza", - "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access": "Indirizzo host (IP o FQDN) per LAN locale e per VBus.net o ID porta seriale per accesso VBus/USB", - "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save": "Se si imposta Reinizializzazione forzata adattatore, l'adattatore si riavvia con una nuova configurazione immediatamente al momento del salvataggio", - "Required for DL3 only": "Richiesto solo per DL3", - "Required only for VBus.net access via DLx/KMx": "Richiesto solo per l'accesso VBus.net tramite DLx / KMx", - "Select VBus Connection Device Type": "Seleziona il tipo di dispositivo di connessione VBus (VBus/LAN, DL3 ecc.)", - "Serial/LANGW": "Serial/LANGW", - "VBus Interval": "Intervallo di aggiornamento VBus (in secondi)", - "VBus Password": "Password VBus", + "DL3 Channel 0": "DL3 Canale 0", + "DL3 Channel 1": "DL3 Canale 1", + "DL3 Channel 2": "DL3 Canale 2", + "DL3 Channel 3": "DL3 Canale 3", + "DL3 Channel 4": "DL3 Canale 4", + "DL3 Channel 5": "DL3 Canale 5", + "DL3 Channel 6": "DL3 Canale 6", + "Desc_ConnectionDevice": "Dispositivo o servizio che stai utilizzando per connetterti al controller Resol.", + "Desc_ConnectionPort": "Porta di connessione TCP del tuo dispositivo - Predefinita: 7053", + "Desc_DL3Channel": "Richiesto solo per DL3: non selezionare nessuno se non si utilizza un DL3.", + "Desc_DeviceAddress": "Indirizzo host (IP o FQDN) del tuo dispositivo nella tua LAN o ID porta della tua porta seriale/USB - Vuoto se vbus.net.", + "Desc_DevicePassword": "Password del tuo dispositivo VBus - Predefinita: vbus", + "Desc_Pollintervall": "Intervallo di aggiornamento in secondi.", + "Desc_Via-tag": "Richiesto solo per l'accesso VBus.net tramite KM2 / DLx - ad esempio: d01234567890.vbus.io", + "Lbl_ConnectionDevice": "Dispositivo/Servizio di connessione", + "Lbl_ConnectionPort": "Porta di connessione TCP", + "Lbl_DL3Channel": "Canale DL3", + "Lbl_DeviceAddress": "Indirizzo del dispositivo", + "Lbl_DevicePassword": "Password del dispositivo", + "Lbl_Pollintervall": "Intervallo di aggiornamento", + "Lbl_Via-tag": "Via-tag", + "Serial to LAN-Gateway": "Gateway da seriale a LAN", "VBus/LAN": "VBus/LAN", - "VBus/USB": "VBus/USB", - "Via tag": "Tramite tag" + "none": "Nessuno", + "Basic settings": "Impostazioni di base" } diff --git a/admin/i18n/nl/translations.json b/admin/i18n/nl/translations.json index 6d693b00..48c1ba31 100644 --- a/admin/i18n/nl/translations.json +++ b/admin/i18n/nl/translations.json @@ -1,29 +1,27 @@ { - "Connection Device": "Verbindingsapparaat", - "Connection Identifier": "Verbindingsidentificatie", - "Connection Port": "Verbindingspoort", - "DL2/KM2": "DL2 / KM2", - "DL3": "DL3", - "DL3 Channel": "DL3-kanaal", - "DL3 Channel 0": "DL3 kanaal 0", - "DL3 Channel 1": "DL3 kanaal 1", - "DL3 Channel 2": "DL3 kanaal 2", - "DL3 Channel 3": "DL3 kanaal 3", - "DL3 Channel 4": "DL3 kanaal 4", - "DL3 Channel 5": "DL3 kanaal 5", - "DL3 Channel 6": "DL3 kanaal 6", - "Default: 7053": "Standaard: 7053", - "Default: vbus": "Standaard: vbus", - "Force Adapter Reinitialization": "Forceer opnieuw initialiseren van adapter", - "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access": "Hostadres (IP of FQDN) voor lokaal LAN en voor VBus.net of seriële poort-ID voor VBus/USB-toegang", - "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save": "Als Force Adapter Reinitialization is ingesteld, wordt de adapter onmiddellijk opnieuw opgestart met een nieuwe configuratie", - "Required for DL3 only": "Alleen vereist voor DL3", - "Required only for VBus.net access via DLx/KMx": "Alleen vereist voor toegang tot VBus.net via DLx / KMx", - "Select VBus Connection Device Type": "Selecteer het type VBus-verbindingsapparaat (VBus/LAN, DL3 enz.)", - "Serial/LANGW": "Serieel/LANGW", - "VBus Interval": "VBus Update-interval (in seconden)", - "VBus Password": "VBus-wachtwoord", + "DL3 Channel 0": "DL3 Kanaal 0", + "DL3 Channel 1": "DL3 Kanaal 1", + "DL3 Channel 2": "DL3 Kanaal 2", + "DL3 Channel 3": "DL3 Kanaal 3", + "DL3 Channel 4": "DL3 Kanaal 4", + "DL3 Channel 5": "DL3 Kanaal 5", + "DL3 Channel 6": "DL3 Kanaal 6", + "Desc_ConnectionDevice": "Apparaat of dienst die u gebruikt om verbinding te maken met uw Resol-controller.", + "Desc_ConnectionPort": "TCP-verbindingspoort van uw apparaat - Standaard: 7053", + "Desc_DL3Channel": "Alleen vereist voor DL3 - Laat niets over als u geen DL3 gebruikt.", + "Desc_DeviceAddress": "Hostadres (IP of FQDN) van uw apparaat in uw LAN of poort-ID van uw seriële/USB-poort - Leeg als vbus.net.", + "Desc_DevicePassword": "Wachtwoord van uw VBus-apparaat - Standaard: vbus", + "Desc_Pollintervall": "Update-interval in seconden.", + "Desc_Via-tag": "Alleen vereist voor VBus.net-toegang via KM2 / DLx - bijvoorbeeld: d01234567890.vbus.io", + "Lbl_ConnectionDevice": "Verbindingsapparaat/dienst", + "Lbl_ConnectionPort": "TCP-verbindingspoort", + "Lbl_DL3Channel": "DL3-kanaal", + "Lbl_DeviceAddress": "Apparaatadres", + "Lbl_DevicePassword": "Apparaat wachtwoord", + "Lbl_Pollintervall": "Bijwerkingsonderbreking", + "Lbl_Via-tag": "Via-tag", + "Serial to LAN-Gateway": "Serieel naar LAN-gateway", "VBus/LAN": "VBus/LAN", - "VBus/USB": "VBus/USB", - "Via tag": "Via tag" + "none": "Geen", + "Basic settings": "Basis instellingen" } diff --git a/admin/i18n/pl/translations.json b/admin/i18n/pl/translations.json index 9c298db9..69e4c3e2 100644 --- a/admin/i18n/pl/translations.json +++ b/admin/i18n/pl/translations.json @@ -1,29 +1,27 @@ { - "Connection Device": "Urządzenie łączące", - "Connection Identifier": "Identyfikator połączenia", - "Connection Port": "Port połączenia", - "DL2/KM2": "DL2 / KM2", - "DL3": "DL3", - "DL3 Channel": "Kanał DL3", - "DL3 Channel 0": "Kanał DL3 0", - "DL3 Channel 1": "Kanał DL3 1", - "DL3 Channel 2": "Kanał DL3 2", - "DL3 Channel 3": "Kanał DL3 3", - "DL3 Channel 4": "Kanał DL3 4", - "DL3 Channel 5": "Kanał DL3 5", - "DL3 Channel 6": "Kanał DL3 6", - "Default: 7053": "Domyślnie: 7053", - "Default: vbus": "Domyślnie: vbus", - "Force Adapter Reinitialization": "Wymuś ponowne zainicjowanie adaptera", - "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access": "Adres hosta (IP lub FQDN) dla lokalnej sieci LAN i VBus.net lub identyfikator portu szeregowego dla dostępu VBus/USB", - "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save": "Jeśli ustawiona jest opcja Wymuś ponowne zainicjowanie adaptera, adapter ponownie uruchamia się z nową konfiguracją natychmiast po zapisaniu", - "Required for DL3 only": "Wymagane tylko dla DL3", - "Required only for VBus.net access via DLx/KMx": "Wymagane tylko dla dostępu VBus.net przez DLx / KMx", - "Select VBus Connection Device Type": "Wybierz typ urządzenia podłączeniowego VBus (VBus/LAN, DL3 itp.)", - "Serial/LANGW": "Szeregowy/LANGW", - "VBus Interval": "Interwał aktualizacji VBus (w sekundach)", - "VBus Password": "Hasło VBus", + "DL3 Channel 0": "DL3 Kanał 0", + "DL3 Channel 1": "DL3 Kanał 1", + "DL3 Channel 2": "DL3 Kanał 2", + "DL3 Channel 3": "DL3 Kanał 3", + "DL3 Channel 4": "DL3 Kanał 4", + "DL3 Channel 5": "DL3 Kanał 5", + "DL3 Channel 6": "DL3 Kanał 6", + "Desc_ConnectionDevice": "Urządzenie lub usługa, której używasz do łączenia się z kontrolerem Resol.", + "Desc_ConnectionPort": "Port połączenia TCP urządzenia — domyślnie: 7053", + "Desc_DL3Channel": "Wymagane tylko w przypadku DL3 — pozostaw opcję brak, jeśli nie używasz DL3.", + "Desc_DeviceAddress": "Adres hosta (IP lub FQDN) Twojego urządzenia w Twojej sieci LAN lub ID portu Twojego portu szeregowego/USB - Puste, jeśli vbus.net.", + "Desc_DevicePassword": "Hasło Twojego urządzenia VBus - Domyślnie: vbus", + "Desc_Pollintervall": "Interwał aktualizacji w sekundach.", + "Desc_Via-tag": "Wymagane tylko w przypadku dostępu VBus.net przez KM2 / DLx - np.: d01234567890.vbus.io", + "Lbl_ConnectionDevice": "Urządzenie połączeniowe/usługa", + "Lbl_ConnectionPort": "Port połączenia TCP", + "Lbl_DL3Channel": "Kanał DL3", + "Lbl_DeviceAddress": "Adres urządzenia", + "Lbl_DevicePassword": "Hasło urządzenia", + "Lbl_Pollintervall": "Interwał aktualizacji", + "Lbl_Via-tag": "Przez tag", + "Serial to LAN-Gateway": "Szeregowy do bramy LAN", "VBus/LAN": "VBus/LAN", - "VBus/USB": "VBus/USB", - "Via tag": "Poprzez tag" + "none": "Nic", + "Basic settings": "Podstawowe ustawienia" } diff --git a/admin/i18n/pt/translations.json b/admin/i18n/pt/translations.json index 4e58cf1e..ffef7b29 100644 --- a/admin/i18n/pt/translations.json +++ b/admin/i18n/pt/translations.json @@ -1,29 +1,27 @@ { - "Connection Device": "Dispositivo de conexão", - "Connection Identifier": "Identificador de conexão", - "Connection Port": "Porta de conexão", - "DL2/KM2": "DL2 / KM2", - "DL3": "DL3", - "DL3 Channel": "Canal DL3", - "DL3 Channel 0": "Canal DL3 0", - "DL3 Channel 1": "Canal DL3 1", - "DL3 Channel 2": "Canal DL3 2", - "DL3 Channel 3": "Canal DL3 3", - "DL3 Channel 4": "Canal DL3 4", - "DL3 Channel 5": "Canal DL3 5", - "DL3 Channel 6": "Canal DL3 6", - "Default: 7053": "Padrão: 7053", - "Default: vbus": "Padrão: vbus", - "Force Adapter Reinitialization": "Forçar reinicialização do adaptador", - "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access": "Endereço de host (IP ou FQDN) para LAN local e para VBus.net ou ID de porta serial para acesso VBus/USB", - "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save": "Se Forçar reinicialização do adaptador estiver definido, o adaptador será reiniciado com a nova configuração imediatamente ao salvar", - "Required for DL3 only": "Necessário apenas para DL3", - "Required only for VBus.net access via DLx/KMx": "Necessário apenas para acesso ao VBus.net via DLx / KMx", - "Select VBus Connection Device Type": "Selecione o tipo de dispositivo de conexão VBus (VBus/LAN, DL3 etc.)", - "Serial/LANGW": "Serial/LANGW", - "VBus Interval": "Intervalo de atualização do VBus (em segundos)", - "VBus Password": "Senha do VBus", - "VBus/LAN": "VBus/LAN", - "VBus/USB": "VBus/USB", - "Via tag": "Via tag" + "DL3 Channel 0": "DL3 Canal 0", + "DL3 Channel 1": "DL3 Canal 1", + "DL3 Channel 2": "DL3 Canal 2", + "DL3 Channel 3": "DL3 Canal 3", + "DL3 Channel 4": "DL3 Canal 4", + "DL3 Channel 5": "DL3 Canal 5", + "DL3 Channel 6": "DL3 Canal 6", + "Desc_ConnectionDevice": "Dispositivo ou serviço que você está usando para se conectar ao controlador Resol.", + "Desc_ConnectionPort": "Porta de conexão TCP do seu dispositivo - Padrão: 7053", + "Desc_DL3Channel": "Obrigatório apenas para DL3 - Deixe como nenhum se você não usar um DL3.", + "Desc_DeviceAddress": "Endereço de host (IP ou FQDN) do seu dispositivo em sua LAN ou ID da porta da sua porta serial/USB - Vazio se for vbus.net.", + "Desc_DevicePassword": "Senha do seu dispositivo VBus - Padrão: vbus", + "Desc_Pollintervall": "Intervalo de atualização em segundos.", + "Desc_Via-tag": "Necessário apenas para acesso VBus.net via KM2/DLx - por exemplo: d01234567890.vbus.io", + "Lbl_ConnectionDevice": "Dispositivo/serviço de conexão", + "Lbl_ConnectionPort": "Porta de conexão TCP", + "Lbl_DL3Channel": "Canal DL3", + "Lbl_DeviceAddress": "Endereço do dispositivo", + "Lbl_DevicePassword": "Senha do dispositivo", + "Lbl_Pollintervall": "Intervalo de atualização", + "Lbl_Via-tag": "Via-tag", + "Serial to LAN-Gateway": "Serial para gateway LAN", + "VBus/LAN": "Barramento V/LAN", + "none": "Nenhum", + "Basic settings": "Configurações básicas" } diff --git a/admin/i18n/ru/translations.json b/admin/i18n/ru/translations.json index 1e50ce92..3b554701 100644 --- a/admin/i18n/ru/translations.json +++ b/admin/i18n/ru/translations.json @@ -1,29 +1,27 @@ { - "Connection Device": "Устройство подключения", - "Connection Identifier": "Идентификатор соединения", - "Connection Port": "Порт подключения", - "DL2/KM2": "DL2 / КМ2", - "DL3": "DL3", - "DL3 Channel": "Канал DL3", - "DL3 Channel 0": "DL3 канал 0", - "DL3 Channel 1": "DL3 канал 1", - "DL3 Channel 2": "DL3 канал 2", - "DL3 Channel 3": "DL3 канал 3", - "DL3 Channel 4": "DL3 канал 4", - "DL3 Channel 5": "DL3 канал 5", - "DL3 Channel 6": "DL3 канал 6", - "Default: 7053": "По умолчанию: 7053", - "Default: vbus": "По умолчанию: vbus", - "Force Adapter Reinitialization": "Реинициализация силового адаптера", - "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access": "Адрес хоста (IP или FQDN) для локальной сети и для VBus.net или Id последовательного порта для доступа к VBus/USB", - "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save": "Если установлена принудительная повторная инициализация адаптера, адаптер перезапускается с новой конфигурацией сразу после сохранения.", - "Required for DL3 only": "Требуется только для DL3", - "Required only for VBus.net access via DLx/KMx": "Требуется только для доступа к VBus.net через DLx / KMx", - "Select VBus Connection Device Type": "Выберите тип устройства подключения VBus (VBus/LAN, DL3 и т. Д.)", - "Serial/LANGW": "Последовательный/LANGW", - "VBus Interval": "Интервал обновления VBus (в секундах)", - "VBus Password": "VBus Пароль", + "DL3 Channel 0": "DL3 Канал 0", + "DL3 Channel 1": "DL3 Канал 1", + "DL3 Channel 2": "DL3 Канал 2", + "DL3 Channel 3": "DL3 Канал 3", + "DL3 Channel 4": "DL3 Канал 4", + "DL3 Channel 5": "DL3 Канал 5", + "DL3 Channel 6": "DL3 Канал 6", + "Desc_ConnectionDevice": "Устройство или сервис, который вы используете для подключения к контроллеру Resol.", + "Desc_ConnectionPort": "Порт TCP-соединения вашего устройства — по умолчанию: 7053.", + "Desc_DL3Channel": "Требуется только для DL3. Если вы не используете DL3, оставьте это значение пустым.", + "Desc_DeviceAddress": "Адрес хоста (IP или полное доменное имя) вашего устройства в вашей локальной сети или идентификатор порта вашего последовательного/USB-порта — пусто, если vbus.net.", + "Desc_DevicePassword": "Пароль вашего устройства VBus — по умолчанию: vbus", + "Desc_Pollintervall": "Интервал обновления в секундах.", + "Desc_Via-tag": "Требуется только для доступа к VBus.net через KM2/DLx — например: d01234567890.vbus.io", + "Lbl_ConnectionDevice": "Устройство подключения / Сервис", + "Lbl_ConnectionPort": "Порт TCP-соединения", + "Lbl_DL3Channel": "Канал DL3", + "Lbl_DeviceAddress": "Адрес устройства", + "Lbl_DevicePassword": "Пароль устройства", + "Lbl_Pollintervall": "Интервал обновления", + "Lbl_Via-tag": "Via-тег", + "Serial to LAN-Gateway": "Последовательный порт к LAN-шлюзу", "VBus/LAN": "VBus/LAN", - "VBus/USB": "VBus/USB", - "Via tag": "Через тег" + "none": "Никто", + "Basic settings": "Базовые настройки" } diff --git a/admin/i18n/uk/translations.json b/admin/i18n/uk/translations.json index 6ff96864..a6654267 100644 --- a/admin/i18n/uk/translations.json +++ b/admin/i18n/uk/translations.json @@ -1,10 +1,4 @@ { - "Connection Device": "Пристрій підключення", - "Connection Identifier": "Ідентифікатор підключення", - "Connection Port": "Порт підключення", - "DL2/KM2": "DL2 / KM2", - "DL3": "DL3", - "DL3 Channel": "Канал DL3", "DL3 Channel 0": "Канал DL3 0", "DL3 Channel 1": "DL3 канал 1", "DL3 Channel 2": "DL3 канал 2", @@ -12,18 +6,22 @@ "DL3 Channel 4": "DL3 канал 4", "DL3 Channel 5": "DL3 Канал 5", "DL3 Channel 6": "DL3 канал 6", - "Default: 7053": "Типове значення: 7053", - "Default: vbus": "За замовчуванням: vbus", - "Force Adapter Reinitialization": "Примусова повторна ініціалізація адаптера", - "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access": "Адреса хоста (IP або FQDN) для локальної локальної мережі та для VBus.net або ідентифікатор послідовного порту для доступу до VBus/USB", - "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save": "Якщо встановлено примусову повторну ініціалізацію адаптера, адаптер перезавантажується з новою конфігурацією відразу після збереження", - "Required for DL3 only": "Необхідно лише для DL3", - "Required only for VBus.net access via DLx/KMx": "Потрібен лише для доступу до VBus.net через DLx / KMx", - "Select VBus Connection Device Type": "Виберіть тип пристрою підключення VBus (VBus/LAN, DL3 тощо)", - "Serial/LANGW": "Послідовний/LANGW", - "VBus Interval": "Інтервал оновлення VBus (у секундах)", - "VBus Password": "Пароль VBus", + "Desc_ConnectionDevice": "Пристрій або служба, які ви використовуєте для підключення до контролера Resol.", + "Desc_ConnectionPort": "Порт підключення TCP вашого пристрою - за замовчуванням: 7053", + "Desc_DL3Channel": "Необхідно лише для DL3. Залиште значення none, якщо ви не використовуєте DL3.", + "Desc_DeviceAddress": "Адреса хоста (IP або FQDN) вашого пристрою у вашій локальній мережі або ідентифікатор порту вашого послідовного/USB-порту - пусто, якщо vbus.net.", + "Desc_DevicePassword": "Пароль вашого пристрою VBus - за замовчуванням: vbus", + "Desc_Pollintervall": "Інтервал оновлення в секундах.", + "Desc_Via-tag": "Необхідно лише для доступу до VBus.net через KM2 / DLx - наприклад: d01234567890.vbus.io", + "Lbl_ConnectionDevice": "Пристрій підключення / Послуга", + "Lbl_ConnectionPort": "Порт підключення TCP", + "Lbl_DL3Channel": "Канал DL3", + "Lbl_DeviceAddress": "Адреса пристрою", + "Lbl_DevicePassword": "Пароль пристрою", + "Lbl_Pollintervall": "Інтервал оновлення", + "Lbl_Via-tag": "Via-тег", + "Serial to LAN-Gateway": "Послідовний шлюз до локальної мережі", "VBus/LAN": "VBus/LAN", - "VBus/USB": "VBus/USB", - "Via tag": "Через тег" + "none": "Жодного", + "Basic settings": "Основні налаштування" } diff --git a/admin/i18n/zh-cn/translations.json b/admin/i18n/zh-cn/translations.json index b6b069d2..03b12cde 100644 --- a/admin/i18n/zh-cn/translations.json +++ b/admin/i18n/zh-cn/translations.json @@ -1,29 +1,27 @@ { - "Connection Device": "连接装置", - "Connection Identifier": "连接标识符", - "Connection Port": "连接口", - "DL2/KM2": "DL2 / KM2", - "DL3": "DL3", - "DL3 Channel": "DL3频道", - "DL3 Channel 0": "DL3频道0", - "DL3 Channel 1": "DL3频道1", - "DL3 Channel 2": "DL3频道2", - "DL3 Channel 3": "DL3频道3", - "DL3 Channel 4": "DL3频道4", - "DL3 Channel 5": "DL3频道5", - "DL3 Channel 6": "DL3频道6", - "Default: 7053": "默认值:7053", - "Default: vbus": "默认值:vbus", - "Force Adapter Reinitialization": "强制适配器重新初始化", - "Host address (IP or FQDN) for local LAN and for VBus.net or Serial Port Id for VBus/USB access": "本地LAN和VBus.net的主机地址(IP或FQDN)或VBus/USB访问的串行端口ID", - "If Force Adapter Reinitialization is set, the adapter restarts with new configuration immediately on save": "如果设置了“强制适配器重新初始化”,则适配器在保存时立即以新配置重新启动", - "Required for DL3 only": "仅DL3需要", - "Required only for VBus.net access via DLx/KMx": "仅通过DLx / KMx访问VBus.net时才需要", - "Select VBus Connection Device Type": "选择VBus连接设备类型(VBus/LAN,DL3等)", - "Serial/LANGW": "串口/LANGW", - "VBus Interval": "VBus更新间隔(以秒为单位)", - "VBus Password": "VBus密码", - "VBus/LAN": "VBus/局域网", - "VBus/USB": "VBus/USB", - "Via tag": "通过标签" + "DL3 Channel 0": "DL3通道0", + "DL3 Channel 1": "DL3通道1", + "DL3 Channel 2": "DL3通道2", + "DL3 Channel 3": "DL3 通道 3", + "DL3 Channel 4": "DL3 通道 4", + "DL3 Channel 5": "DL3 通道 5", + "DL3 Channel 6": "DL3 通道 6", + "Desc_ConnectionDevice": "您用来连接到 Resol 控制器的设备或服务。", + "Desc_ConnectionPort": "设备的 TCP 连接端口 - 默认:7053", + "Desc_DL3Channel": "仅 DL3 需要 - 如果您不使用 DL3,则保留为“无”。", + "Desc_DeviceAddress": "LAN 中设备的主机地址(IP 或 FQDN)或串行/USB 端口的端口 ID - 如果 vbus.net,则为空。", + "Desc_DevicePassword": "VBus 设备的密码 - 默认:vbus", + "Desc_Pollintervall": "更新间隔(以秒为单位)。", + "Desc_Via-tag": "仅需要通过 KM2 / DLx 访问 VBus.net - 例如:d01234567890.vbus.io", + "Lbl_ConnectionDevice": "连接设备/服务", + "Lbl_ConnectionPort": "TCP连接端口", + "Lbl_DL3Channel": "DL3频道", + "Lbl_DeviceAddress": "设备地址", + "Lbl_DevicePassword": "设备密码", + "Lbl_Pollintervall": "更新间隔", + "Lbl_Via-tag": "通过标签", + "Serial to LAN-Gateway": "串行到 LAN 网关", + "VBus/LAN": "总线/局域网", + "none": "没有任何", + "Basic settings": "基本设置" } diff --git a/admin/jsonConfig.json b/admin/jsonConfig.json new file mode 100644 index 00000000..bf519e32 --- /dev/null +++ b/admin/jsonConfig.json @@ -0,0 +1,103 @@ +{ + "i18n": true, + "type": "panel", + "items": { + "_basicSection": { + "newLine": true, + "type" : "header", + "text" : "Basic settings", + "size": 2, + "sm": 12, + "md": 12, + "lg": 12 + }, + "connectionDevice": { + "newLine": true, + "type": "select", + "label": "Lbl_ConnectionDevice", + "help" : "Desc_ConnectionDevice", + "options": [ + {"label":{"en": "VBus/LAN"}, "value": "lan"}, + {"label":{"en": "KM2/DL2"}, "value": "dl2"}, + {"label":{"en": "DL3/DL2Plus"}, "value": "dl3"}, + {"label":{"en": "Serial/USB"}, "value": "serial"}, + {"label":{"en": "Serial to LAN gateway"}, "value": "langw"} + ], + "sm": 12, + "md": 4, + "lg": 4 + }, + "connectionIdentifier": { + "type": "text", + "label": "Lbl_DeviceAddress", + "help" : "Desc_DeviceAddress", + "sm": 12, + "md": 4, + "lg": 4 + }, + "connectionPort": { + "type": "number", + "min": 1, + "max": 65565, + "label": "Lbl_ConnectionPort", + "default": 7053, + "help": "Desc_ConnectionPort", + "sm": 12, + "md": 4, + "lg": 4 + }, + "vbusPassword": { + "newLine": true, + "type": "password", + "repeat": false, + "visible": true, + "label": "Lbl_DevicePassword", + "help" : "Desc_DevicePassword", + "default": "vbus", + "sm": 12, + "md": 4, + "lg": 4 + }, + "vbusChannel": { + "type": "select", + "label": "Lbl_DL3Channel", + "help" : "Desc_DL3Channel", + "default": 7, + "options": [ + {"label":{"en": "None"}, "value": 7}, + {"label":{"en": "DL3 Channel 1"}, "value": 1}, + {"label":{"en": "DL3 Channel 2"}, "value": 2}, + {"label":{"en": "DL3 Channel 3"}, "value": 3}, + {"label":{"en": "DL3 Channel 4"}, "value": 4}, + {"label":{"en": "DL3 Channel 5"}, "value": 5}, + {"label":{"en": "DL3 Channel 6"}, "value": 6}, + {"label":{"en": "DL3 Channel 0"}, "value": 0} + ], + "sm": 12, + "md": 4, + "lg": 4 + }, + "vbusViaTag": { + "type": "text", + "label": "Lbl_Via-tag", + "default": "", + "help": "Desc_Via-tag", + "sm": 12, + "md": 4, + "lg": 4 + }, + "vbusInterval": { + "newLine": true, + "type": "number", + "min": 30, + "max": 300, + "step": 30, + "label": "Lbl_Pollintervall", + "default": 30, + "help": "Desc_Pollintervall", + "sm": 12, + "md": 4, + "lg": 4 + } + } + } \ No newline at end of file diff --git a/io-package.json b/io-package.json index f9827216..63f364df 100644 --- a/io-package.json +++ b/io-package.json @@ -1,194 +1,206 @@ { - "common": { - "name": "myvbus", - "version": "0.2.5", - "news": { - "0.2.5": { - "en": "Updated dependencies\nFix: reconnect handling for serial connections", - "de": "Aktualisierte Abhängigkeiten\nFix: Reconnect-Handling für serielle Verbindungen", - "ru": "Обновленные зависимости\nИсправление: переподключение обработки для серийных соединений", - "pt": "Dependências atualizadas\nFix: manuseio de reconectar para conexões seriais", - "nl": "Verouderde afhankelijkheid\nVerbinding met de serieverbinding", - "fr": "Mise à jour des dépendances\nCorrection : reconnecter la manipulation pour les connexions série", - "it": "Dipendenze aggiornate\nFisso: ricollegare la gestione per connessioni seriali", - "es": "Dependencias actualizadas\nFijación: manipulación de reconexión para conexiones serie", - "pl": "Zależność od upoważnienia\nFix: reconnecting", - "uk": "Оновлені залежності\nВиправлення: відключення обробки для серійних підключень", - "zh-cn": "A. 最新依赖情况\n九:重新联系" - }, - "0.2.4": { - "en": "Fix password check", - "de": "Passwort überprüfen", - "ru": "Исправлена проверка пароля", - "pt": "Corrigir verificação de senha", - "nl": "Vertaling:", - "fr": "Correction du mot de passe", - "it": "Verifica password", - "es": "Control de contraseña", - "pl": "Fix password", - "uk": "Перевірка пароля", - "zh-cn": "Fix 密码检查" - }, - "0.2.3": { - "en": "Updated dependencies\nNew: Use adapter-dev instead of gulp translate\nFix: error handling for serial connections", - "de": "Aktualisierte Abhängigkeiten\nNeu: Verwenden Sie Adapter-dev anstelle von gulp translate\nFix: Fehlerbehandlung für serielle Verbindungen", - "ru": "Обновленные зависимости\nНовый: Используйте адаптер-dev вместо gulp перевести\nИсправление: обработка ошибок для серийных соединений", - "pt": "Dependências atualizadas\nNovo: Use o adaptador-dev em vez de gulp traduzir\nFix: manipulação de erros para conexões seriais", - "nl": "Verouderde afhankelijkheid\nGebruik adapter-dev in plaats van gulp vertaal\nVergissing voor serieverbindingen", - "fr": "Mise à jour des dépendances\nNouveau: Utilisez adaptateur-dev au lieu de traduire gulp\nCorrection : manipulation d'erreurs pour les connexions série", - "it": "Dipendenze aggiornate\nNuovo: Utilizzare adattatore-dev invece di gulp tradurre\nFix: gestione degli errori per connessioni seriali", - "es": "Dependencias actualizadas\nNuevo: Usar adaptador-dev en lugar de traducir gulp\nCorrección: manejo de errores para conexiones seriales", - "pl": "Zależność od upoważnienia\nNowy: Zastosowanie adapter-dev zamiast gulpów\nObserwowanie błędów dla połączeń szeregowych", - "uk": "Оновлені залежності\nНовий: Використовуйте адаптер-dev замість гіпульти перекладу\nВиправлення: обробка помилок для серійних підключень", - "zh-cn": "A. 最新依赖情况\n新的:使用适应器而不是固体字。\nFix:对帐篷的错误处理" - }, - "0.2.2": { - "en": "Updated dependencies / Compatibility check for js-controller 4.0 / Support for js-controller 1.x dropped", - "de": "Aktualisierte Abhängigkeiten / Kompatibilitätsprüfung für js-controller 4.0 / Unterstützung für js-controller 1.x eingestellt", - "ru": "Обновлены зависимости / Проверка совместимости для js-controller 4.0 / Прекращена поддержка js-controller 1.x", - "pt": "Dependências atualizadas/verificação de compatibilidade para js-controller 4.0/suporte para js-controller 1.x descartado", - "nl": "Bijgewerkte afhankelijkheden / Compatibiliteitscontrole voor js-controller 4.0 / Ondersteuning voor js-controller 1.x weggevallen", - "fr": "Dépendances mises à jour / Vérification de compatibilité pour js-controller 4.0 / Prise en charge de js-controller 1.x abandonnée", - "it": "Dipendenze aggiornate/Verifica compatibilità per js-controller 4.0/Supporto per js-controller 1.x eliminato", - "es": "Dependencias actualizadas / Verificación de compatibilidad para js-controller 4.0 / Se eliminó el soporte para js-controller 1.x", - "pl": "Zaktualizowane zależności / Sprawdzanie zgodności dla js-controller 4.0 / Porzucono wsparcie dla js-controller 1.x", - "zh-cn": "更新了 js-controller 4.0 的依赖项/兼容性检查/对 js-controller 1.x 的支持已删除", - "uk": "Оновлені залежності / Перевірка сумісності для js-controller 4.0 / Підтримка js-controller 1.x припинена" - }, - "0.2.1": { - "en": "Update dependencies\nChanged allowed range of temperature values to include the error values for short circuit and open circuit", - "de": "Abhängigkeiten aktualisieren\nDer zulässige Temperaturbereich wurde geändert, um die Fehlerwerte für Kurzschluss und Leerlauf einzuschließen", - "ru": "Обновить зависимости\nИзменен допустимый диапазон значений температуры, чтобы включить значения ошибок для короткого замыкания и обрыва.", - "pt": "Atualizar dependências\nFaixa permitida de valores de temperatura alterada para incluir os valores de erro para curto-circuito e circuito aberto", - "nl": "Afhankelijkheden bijwerken\nToegestaan bereik van temperatuurwaarden gewijzigd om de foutwaarden voor kortsluiting en open circuit op te nemen", - "fr": "Mettre à jour les dépendances\nModification de la plage autorisée des valeurs de température pour inclure les valeurs d'erreur pour les courts-circuits et les circuits ouverts", - "it": "Aggiorna dipendenze\nModificato l'intervallo consentito di valori di temperatura per includere i valori di errore per cortocircuito e circuito aperto", - "es": "Actualizar dependencias\nSe modificó el rango permitido de valores de temperatura para incluir los valores de error para cortocircuito y circuito abierto.", - "pl": "Aktualizuj zależności\nZmieniono dozwolony zakres wartości temperatury, aby uwzględnić wartości błędów dla zwarcia i obwodu otwartego", - "zh-cn": "更新依赖\n更改了允许的温度值范围以包括短路和开路的误差值", - "uk": "Оновити залежності\nЗмінено дозволений діапазон значень температури, щоб включити значення похибок для короткого замикання та розриву" - }, - "0.2.0": { - "en": "Dropped node.js 10 support, added node.js 14 and 16 support", - "de": "Unterstützung für node.js 10 entfernt, Unterstützung für node.js 14 und 16 hinzugefügt", - "ru": "Прекращена поддержка node.js 10, добавлена ​​поддержка node.js 14 и 16", - "pt": "Suporte a node.js 10 removido, suporte a node.js 14 e 16 adicionado", - "nl": "Ondersteuning voor node.js 10 verwijderd, ondersteuning voor node.js 14 en 16 toegevoegd", - "fr": "Prise en charge de node.js 10 supprimée, prise en charge de node.js 14 et 16 ajoutée", - "it": "Eliminato il supporto node.js 10, aggiunto il supporto node.js 14 e 16", - "es": "Se eliminó la compatibilidad con node.js 10, se agregó compatibilidad con node.js 14 y 16", - "pl": "Zrezygnowano z obsługi node.js 10, dodano obsługę node.js 14 i 16", - "zh-cn": "删除了 node.js 10 支持,添加了 node.js 14 和 16 支持", - "uk": "Припинено підтримку node.js 10, додано підтримку node.js 14 і 16" - }, - "0.1.1": { - "en": "Fixes for supporting js-controller >=3.2.x", - "de": "Korrekturen zur Unterstützung von js-controller> = 3.2.x.", - "ru": "Исправления для поддержки js-controller> = 3.2.x", - "pt": "Correções para suportar js-controller> = 3.2.x", - "nl": "Oplossingen voor ondersteuning van js-controller> = 3.2.x", - "fr": "Corrections pour la prise en charge de js-controller> = 3.2.x", - "it": "Correzioni per il supporto di js-controller> = 3.2.x", - "es": "Correcciones para admitir js-controller> = 3.2.x", - "pl": "Poprawki dotyczące obsługi js-controller> = 3.2.x", - "zh-cn": "修复了支持js-controller> = 3.2.x的问题", - "uk": "Виправлення для підтримки js-контролера >=3.2.x" - } + "common": { + "name": "myvbus", + "version": "0.2.5", + "news": { + "0.2.5": { + "en": "Updated dependencies\nFix: reconnect handling for serial connections", + "de": "Aktualisierte Abhängigkeiten\nFix: Reconnect-Handling für serielle Verbindungen", + "ru": "Обновленные зависимости\nИсправление: переподключение обработки для серийных соединений", + "pt": "Dependências atualizadas\nFix: manuseio de reconectar para conexões seriais", + "nl": "Verouderde afhankelijkheid\nVerbinding met de serieverbinding", + "fr": "Mise à jour des dépendances\nCorrection : reconnecter la manipulation pour les connexions série", + "it": "Dipendenze aggiornate\nFisso: ricollegare la gestione per connessioni seriali", + "es": "Dependencias actualizadas\nFijación: manipulación de reconexión para conexiones serie", + "pl": "Zależność od upoważnienia\nFix: reconnecting", + "uk": "Оновлені залежності\nВиправлення: відключення обробки для серійних підключень", + "zh-cn": "A. 最新依赖情况\n九:重新联系" + }, + "0.2.4": { + "en": "Fix password check", + "de": "Passwort überprüfen", + "ru": "Исправлена проверка пароля", + "pt": "Corrigir verificação de senha", + "nl": "Vertaling:", + "fr": "Correction du mot de passe", + "it": "Verifica password", + "es": "Control de contraseña", + "pl": "Fix password", + "uk": "Перевірка пароля", + "zh-cn": "Fix 密码检查" + }, + "0.2.3": { + "en": "Updated dependencies\nNew: Use adapter-dev instead of gulp translate\nFix: error handling for serial connections", + "de": "Aktualisierte Abhängigkeiten\nNeu: Verwenden Sie Adapter-dev anstelle von gulp translate\nFix: Fehlerbehandlung für serielle Verbindungen", + "ru": "Обновленные зависимости\nНовый: Используйте адаптер-dev вместо gulp перевести\nИсправление: обработка ошибок для серийных соединений", + "pt": "Dependências atualizadas\nNovo: Use o adaptador-dev em vez de gulp traduzir\nFix: manipulação de erros para conexões seriais", + "nl": "Verouderde afhankelijkheid\nGebruik adapter-dev in plaats van gulp vertaal\nVergissing voor serieverbindingen", + "fr": "Mise à jour des dépendances\nNouveau: Utilisez adaptateur-dev au lieu de traduire gulp\nCorrection : manipulation d'erreurs pour les connexions série", + "it": "Dipendenze aggiornate\nNuovo: Utilizzare adattatore-dev invece di gulp tradurre\nFix: gestione degli errori per connessioni seriali", + "es": "Dependencias actualizadas\nNuevo: Usar adaptador-dev en lugar de traducir gulp\nCorrección: manejo de errores para conexiones seriales", + "pl": "Zależność od upoważnienia\nNowy: Zastosowanie adapter-dev zamiast gulpów\nObserwowanie błędów dla połączeń szeregowych", + "uk": "Оновлені залежності\nНовий: Використовуйте адаптер-dev замість гіпульти перекладу\nВиправлення: обробка помилок для серійних підключень", + "zh-cn": "A. 最新依赖情况\n新的:使用适应器而不是固体字。\nFix:对帐篷的错误处理" + }, + "0.2.2": { + "en": "Updated dependencies / Compatibility check for js-controller 4.0 / Support for js-controller 1.x dropped", + "de": "Aktualisierte Abhängigkeiten / Kompatibilitätsprüfung für js-controller 4.0 / Unterstützung für js-controller 1.x eingestellt", + "ru": "Обновлены зависимости / Проверка совместимости для js-controller 4.0 / Прекращена поддержка js-controller 1.x", + "pt": "Dependências atualizadas/verificação de compatibilidade para js-controller 4.0/suporte para js-controller 1.x descartado", + "nl": "Bijgewerkte afhankelijkheden / Compatibiliteitscontrole voor js-controller 4.0 / Ondersteuning voor js-controller 1.x weggevallen", + "fr": "Dépendances mises à jour / Vérification de compatibilité pour js-controller 4.0 / Prise en charge de js-controller 1.x abandonnée", + "it": "Dipendenze aggiornate/Verifica compatibilità per js-controller 4.0/Supporto per js-controller 1.x eliminato", + "es": "Dependencias actualizadas / Verificación de compatibilidad para js-controller 4.0 / Se eliminó el soporte para js-controller 1.x", + "pl": "Zaktualizowane zależności / Sprawdzanie zgodności dla js-controller 4.0 / Porzucono wsparcie dla js-controller 1.x", + "zh-cn": "更新了 js-controller 4.0 的依赖项/兼容性检查/对 js-controller 1.x 的支持已删除", + "uk": "Оновлені залежності / Перевірка сумісності для js-controller 4.0 / Підтримка js-controller 1.x припинена" + }, + "0.2.1": { + "en": "Update dependencies\nChanged allowed range of temperature values to include the error values for short circuit and open circuit", + "de": "Abhängigkeiten aktualisieren\nDer zulässige Temperaturbereich wurde geändert, um die Fehlerwerte für Kurzschluss und Leerlauf einzuschließen", + "ru": "Обновить зависимости\nИзменен допустимый диапазон значений температуры, чтобы включить значения ошибок для короткого замыкания и обрыва.", + "pt": "Atualizar dependências\nFaixa permitida de valores de temperatura alterada para incluir os valores de erro para curto-circuito e circuito aberto", + "nl": "Afhankelijkheden bijwerken\nToegestaan bereik van temperatuurwaarden gewijzigd om de foutwaarden voor kortsluiting en open circuit op te nemen", + "fr": "Mettre à jour les dépendances\nModification de la plage autorisée des valeurs de température pour inclure les valeurs d'erreur pour les courts-circuits et les circuits ouverts", + "it": "Aggiorna dipendenze\nModificato l'intervallo consentito di valori di temperatura per includere i valori di errore per cortocircuito e circuito aperto", + "es": "Actualizar dependencias\nSe modificó el rango permitido de valores de temperatura para incluir los valores de error para cortocircuito y circuito abierto.", + "pl": "Aktualizuj zależności\nZmieniono dozwolony zakres wartości temperatury, aby uwzględnić wartości błędów dla zwarcia i obwodu otwartego", + "zh-cn": "更新依赖\n更改了允许的温度值范围以包括短路和开路的误差值", + "uk": "Оновити залежності\nЗмінено дозволений діапазон значень температури, щоб включити значення похибок для короткого замикання та розриву" + }, + "0.2.0": { + "en": "Dropped node.js 10 support, added node.js 14 and 16 support", + "de": "Unterstützung für node.js 10 entfernt, Unterstützung für node.js 14 und 16 hinzugefügt", + "ru": "Прекращена поддержка node.js 10, добавлена ​​поддержка node.js 14 и 16", + "pt": "Suporte a node.js 10 removido, suporte a node.js 14 e 16 adicionado", + "nl": "Ondersteuning voor node.js 10 verwijderd, ondersteuning voor node.js 14 en 16 toegevoegd", + "fr": "Prise en charge de node.js 10 supprimée, prise en charge de node.js 14 et 16 ajoutée", + "it": "Eliminato il supporto node.js 10, aggiunto il supporto node.js 14 e 16", + "es": "Se eliminó la compatibilidad con node.js 10, se agregó compatibilidad con node.js 14 y 16", + "pl": "Zrezygnowano z obsługi node.js 10, dodano obsługę node.js 14 i 16", + "zh-cn": "删除了 node.js 10 支持,添加了 node.js 14 和 16 支持", + "uk": "Припинено підтримку node.js 10, додано підтримку node.js 14 і 16" + }, + "0.1.1": { + "en": "Fixes for supporting js-controller >=3.2.x", + "de": "Korrekturen zur Unterstützung von js-controller> = 3.2.x.", + "ru": "Исправления для поддержки js-controller> = 3.2.x", + "pt": "Correções para suportar js-controller> = 3.2.x", + "nl": "Oplossingen voor ondersteuning van js-controller> = 3.2.x", + "fr": "Corrections pour la prise en charge de js-controller> = 3.2.x", + "it": "Correzioni per il supporto di js-controller> = 3.2.x", + "es": "Correcciones para admitir js-controller> = 3.2.x", + "pl": "Poprawki dotyczące obsługi js-controller> = 3.2.x", + "zh-cn": "修复了支持js-controller> = 3.2.x的问题", + "uk": "Виправлення для підтримки js-контролера >=3.2.x" + } + }, + "titleLang": { + "en": "Resol VBUS", + "de": "Resol VBUS", + "ru": "Resol VBUS", + "pt": "Resol VBUS", + "nl": "Resol VBUS", + "fr": "Resol VBUS", + "it": "Resol VBUS", + "es": "Resol VBUS", + "pl": "Resol VBUS", + "zh-cn": "Resol VBUS适配器", + "uk": "Розв'язати VBUS" + }, + "desc": { + "en": "This adapter connects ioBroker to VBus-based Resol devices", + "de": "Dieser Adapter verbindet ioBroker mit VBus-basierten Resol-Geräten", + "ru": "Этот адаптер подключает ioBroker к устройствам Resol на базе VBus.", + "pt": "Este adaptador conecta o ioBroker a dispositivos Resol baseados em VBus", + "nl": "Deze adapter verbindt ioBroker met op VBus gebaseerde Resol-apparaten", + "fr": "Cet adaptateur connecte ioBroker aux appareils Resol basés sur VBus", + "it": "Questo adattatore collega ioBroker a dispositivi Resol basati su VBus", + "es": "Este adaptador conecta ioBroker a dispositivos Resol basados ​​en VBus", + "pl": "Ten adapter łączy ioBroker z urządzeniami Resol opartymi na VBus", + "zh-cn": "此适配器将 ioBroker 连接到基于 VBus 的 Resol 设备", + "uk": "Цей адаптер підключає ioBroker до пристроїв Resol на основі VBus" + }, + "authors": [ + "pdbjjens " + ], + "contributors": [ + "DutchmanNL", + "grizzelbee " + ], + "keywords": [ + "myvbus", + "VBus", + "Resol" + ], + "license": "MIT", + "platform": "Javascript/Node.js", + "main": "main.js", + "icon": "myvbus.png", + "enabled": true, + "extIcon": "https://raw.githubusercontent.com/iobroker-community-adapters/ioBroker.myvbus/master/admin/myvbus.png", + "readme": "https://github.com/iobroker-community-adapters/ioBroker.myvbus/blob/master/README.md", + "loglevel": "info", + "mode": "daemon", + "type": "climate-control", + "compact": true, + "materialize": true, + "materializeTab": true, + "supportCustoms": false, + "connectionType": "local", + "dataSource": "push", + "adminUI": { + "config": "json" + }, + "dependencies": [ + { + "js-controller": ">=4.0.15" + } + ], + "globalDependencies": [ + { + "admin": ">=5.2.28" + } + ] }, - "titleLang": { - "en": "Resol VBUS", - "de": "Resol VBUS", - "ru": "Resol VBUS", - "pt": "Resol VBUS", - "nl": "Resol VBUS", - "fr": "Resol VBUS", - "it": "Resol VBUS", - "es": "Resol VBUS", - "pl": "Resol VBUS", - "zh-cn": "Resol VBUS适配器", - "uk": "Розв'язати VBUS" - }, - "desc": { - "en": "This adapter connects ioBroker to VBus-based Resol devices", - "de": "Dieser Adapter verbindet ioBroker mit VBus-basierten Resol-Geräten", - "ru": "Этот адаптер подключает ioBroker к устройствам Resol на базе VBus.", - "pt": "Este adaptador conecta o ioBroker a dispositivos Resol baseados em VBus", - "nl": "Deze adapter verbindt ioBroker met op VBus gebaseerde Resol-apparaten", - "fr": "Cet adaptateur connecte ioBroker aux appareils Resol basés sur VBus", - "it": "Questo adattatore collega ioBroker a dispositivi Resol basati su VBus", - "es": "Este adaptador conecta ioBroker a dispositivos Resol basados ​​en VBus", - "pl": "Ten adapter łączy ioBroker z urządzeniami Resol opartymi na VBus", - "zh-cn": "此适配器将 ioBroker 连接到基于 VBus 的 Resol 设备", - "uk": "Цей адаптер підключає ioBroker до пристроїв Resol на основі VBus" - }, - "authors": [ - "pdbjjens " - ], - "contributors": [ - "DutchmanNL", - "grizzelbee " + "protectedNative": [ + "vbusPassword" ], - "keywords": [ - "myvbus", - "VBus", - "Resol" + "encryptedNative": [ + "vbusPassword" ], - "license": "MIT", - "platform": "Javascript/Node.js", - "main": "main.js", - "icon": "myvbus.png", - "enabled": true, - "extIcon": "https://raw.githubusercontent.com/iobroker-community-adapters/ioBroker.myvbus/master/admin/myvbus.png", - "readme": "https://github.com/iobroker-community-adapters/ioBroker.myvbus/blob/master/README.md", - "loglevel": "info", - "mode": "daemon", - "type": "climate-control", - "compact": true, - "materialize": true, - "materializeTab": true, - "supportCustoms": false, - "connectionType": "local", - "dataSource": "push", - "dependencies": [ - { - "js-controller": ">=2.0.0" - } - ] - }, - "native": { - "connectionDevice": "", - "connectionIdentifier": "", - "connectionPort": 7053, - "vbusPassword": "", - "vbusChannel": 1, - "vbusDataOnly": false, - "vbusViaTag": "", - "vbusInterval": 30, - "forceReInit": true - }, - "objects": [], - "instanceObjects": [ - { - "_id": "info", - "type": "channel", - "common": { - "name": "Information", - "type": "string" - }, - "native": {} + "native": { + "connectionDevice": "", + "connectionIdentifier": "", + "connectionPort": 7053, + "vbusPassword": "", + "vbusChannel": 7, + "vbusViaTag": "", + "vbusInterval": 30 }, - { - "_id": "info.connection", - "type": "state", - "common": { - "role": "indicator.connected", - "name": "VBus device connected", - "type": "boolean", - "read": true, - "write": false, - "def": false - }, - "native": {} - } - ] + "objects": [], + "instanceObjects": [ + { + "_id": "info", + "type": "channel", + "common": { + "name": "Information", + "type": "string" + }, + "native": {} + }, + { + "_id": "info.connection", + "type": "state", + "common": { + "role": "indicator.connected", + "name": "VBus device connected", + "type": "boolean", + "read": true, + "write": false, + "def": false + }, + "native": {} + } + ] } diff --git a/main.js b/main.js index a5c0caf1..c1cfea81 100644 --- a/main.js +++ b/main.js @@ -73,12 +73,94 @@ class MyVbus extends utils.Adapter { const spec = new vbus.Specification({ language: language }); + + // Set up connection depending on connection device + switch (this.config.connectionDevice) { + case 'lan': + ctx.connection = new vbus.TcpConnection({ + host: this.config.connectionIdentifier, + port: this.config.connectionPort, + password: this.config.vbusPassword + }); + this.log.info('TCP Connection via LAN to [' + this.config.connectionIdentifier + ':' + this.config.connectionPort + '] selected'); + break; + + case 'serial': + ctx.connection = new vbus.SerialConnection({ + path: this.config.connectionIdentifier + }); + this.log.info('Serial Connection at [' + this.config.connectionIdentifier + '] selected'); + break; + + case 'langw': + ctx.connection = new vbus.TcpConnection({ + host: this.config.connectionIdentifier, + port: this.config.connectionPort, + rawVBusDataOnly: true + }); + this.log.info('TCP Connection via LAN-gw to [' + this.config.connectionIdentifier + ':' + this.config.connectionPort + '] selected'); + break; + /** + case 'inet': + this.log.debug('VBus.net Connection via [' + this.config.vbusViaTag.substring(12, this.config.vbusViaTag.length) + '] selected'); + this.log.debug('VBus.net Connection via [' + this.config.vbusViaTag.substring(0, 11) + '] selected'); + ctx.connection = new vbus.TcpConnection({ + //host: this.config.connectionIdentifier, + host: this.config.vbusViaTag.substring(12, this.config.vbusViaTag.length), + port: this.config.connectionPort, + password: this.config.vbusPassword, + viaTag: this.config.vbusViaTag.substring(0, 11) + }); + this.log.info('VBus.net Connection via [' + this.config.vbusViaTag + '] selected'); + break; +**/ + case 'dl2': + if (this.config.connectionIdentifier.match(vbusioformat)) { + ctx.connection = new vbus.TcpConnection({ + host: this.config.connectionIdentifier, + port: this.config.connectionPort, + password: this.config.vbusPassword, + viaTag: this.config.vbusViaTag + }); + this.log.info('VBus.net Connection to KM2/DL2 via [' + this.config.connectionIdentifier + ' via ' + this.config.vbusViaTag + '] selected'); + } else { + ctx.connection = new vbus.TcpConnection({ + host: this.config.connectionIdentifier, + port: this.config.connectionPort, + password: this.config.vbusPassword + }); + this.log.info('TCP Connection to KM2/DL2 on [' + this.config.connectionIdentifier + ':' + this.config.connectionPort + '] selected'); + } + break; + + case 'dl3': + if (this.config.connectionIdentifier.match(vbusioformat)) { + ctx.connection = new vbus.TcpConnection({ + host: this.config.connectionIdentifier, + port: this.config.connectionPort, + password: this.config.vbusPassword, + channel: this.config.vbusChannel, + viaTag: this.config.vbusViaTag + }); + this.log.info('VBus.net Connection to DL3 channel ' + this.config.vbusChannel + ' via [' + this.config.connectionIdentifier + ' via ' + this.config.vbusViaTag + '] selected'); + } else { + ctx.connection = new vbus.TcpConnection({ + host: this.config.connectionIdentifier, + port: this.config.connectionPort, + password: this.config.vbusPassword, + channel: this.config.vbusChannel + }); + this.log.info('TCP Connection to DL3 channel ' + this.config.vbusChannel + ' on [' + this.config.connectionIdentifier + ':' + this.config.connectionPort + '] selected'); + } + } + + /** // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: const connectionDevice = this.config.connectionDevice; const connectionIdentifier = this.config.connectionIdentifier; const connectionPort = this.config.connectionPort; - let vbusPassword = this.config.vbusPassword; + const vbusPassword = this.config.vbusPassword; const vbusChannel = this.config.vbusChannel; const vbusDataOnly = this.config.vbusDataOnly; const vbusViaTag = this.config.vbusViaTag; @@ -88,32 +170,11 @@ class MyVbus extends utils.Adapter { this.log.debug(`Connection Type: ${connectionDevice}`); this.log.debug(`Connection Identifier: ${connectionIdentifier}`); this.log.debug(`Connection Port: ${connectionPort}`); - this.log.debug(`VBus Password encrypted: ${vbusPassword}`); + this.log.debug(`VBus Password: ${vbusPassword}`); this.log.debug(`VBus Channel: ${vbusChannel}`); this.log.debug(`VBus Via Tag: ${vbusViaTag}`); this.log.debug(`VBus Interval: ${vbusInterval}`); - // Check if credentials are not empty and decrypt stored password - if (!(connectionDevice==='serial' || connectionDevice==='langw')) { - if (vbusPassword && vbusPassword !== '') { - await this.getForeignObjectAsync('system.config') - .then(obj => { - if (obj && obj.native && obj.native.secret) { - //noinspection JSUnresolvedVariable - vbusPassword = this.decrypt(obj.native.secret, vbusPassword); - } else { - //noinspection JSUnresolvedVariable - vbusPassword = this.decrypt('Zgfr56gFe87jJOM', vbusPassword); - } - }); - //.catch(err => { - // throw (err); - //}); - - } else { - throw new Error(('[Credentials] error: Password missing or empty in Adapter Settings')); - } - } // Set up connection depending on connection device and check connection identifier switch (connectionDevice) { @@ -201,7 +262,7 @@ class MyVbus extends utils.Adapter { throw new Error(('Host-address not valid. Should be IP-address or FQDN')); } } - +**/ // Connection state handler ctx.connection.on('connectionState', (connectionState) => { @@ -250,8 +311,8 @@ class MyVbus extends utils.Adapter { }); ctx.hsc = new vbus.HeaderSetConsolidator({ - interval: vbusInterval * 1000, - timeToLive: (vbusInterval * 1000) + 1000 + interval: this.config.vbusInterval * 1000, + timeToLive: (this.config.vbusInterval * 1000) + 1000 }); // HeaderSetConsolidator handler - creates object tree and updates values in preset interval @@ -274,7 +335,7 @@ class MyVbus extends utils.Adapter { }; }); - this.log.debug('received data: ' + JSON.stringify(data)); + //this.log.debug('received data: ' + JSON.stringify(data)); if (data[1]){ // create device this.createOrExtendObject(data[1].deviceId, { @@ -385,11 +446,118 @@ class MyVbus extends utils.Adapter { } } + /* + * @param {object} config Current active config for adapter + * @returns {string} Result of the check + * */ + async configIsValid(config) { + //this.log.debug('configIsValid Function '); + //this.log.debug('Entering Function [configIsValid]'); + // Log the current config given to the function + this.log.debug(`Connection Type: ${this.config.connectionDevice}`); + this.log.debug(`Connection Identifier: ${this.config.connectionIdentifier}`); + this.log.debug(`Connection Port: ${this.config.connectionPort}`); + this.log.debug(`VBus Password: ${this.config.vbusPassword}`); + this.log.debug(`VBus Channel: ${this.config.vbusChannel}`); + this.log.debug(`VBus Via Tag: ${this.config.vbusViaTag}`); + this.log.debug(`VBus Interval: ${this.config.vbusInterval}`); + return new Promise( + function (resolve, reject) { + // some helper functions + function testSerialformat(config) { + if (!config.connectionIdentifier.match(serialformat)) { + reject('Serialformat is invalid! Please fix.'); + } + } + + function testIP_and_FQDN_Format(config) { + if (!config.connectionIdentifier.match(ipformat) && !config.connectionIdentifier.match(fqdnformat)) { + reject('[' + config.connectionIdentifier + '] is neither a valid IP-Format nor a fully qualified domain name (FQDN)!'); + } + } + /** + function testVBusIOFormat(config) { + if (!config.vbusViaTag.match(vbusioformat)) { + reject('VBusIO-Format is invalid! Should be something like [d01234567890.vbus.io] or [d01234567890.vbus.net].'); + } + } + **/ + function testPassword(config) { + if (!config.vbusPassword || '' === config.vbusPassword) { + reject('Password is missing!'); + } + } + + function testPort(config) { + if ('' === config.connectionPort || 0 === config.connectionPort) { + reject('Invalid connection port given! Should be > 0.'); + } + } + + function testChannel(config) { + if (config.vbusChannel < 1 || config.vbusChannel >= 7) { + reject('Invalid DL3 channel given! Should be between 1 and 6.'); + } + } + + // switch connectionDevice seleted by User + if (config.connectionDevice === 'serial') { + testSerialformat(config); + resolve('Config seems to be valid for USB/Serial.'); + } else if (config.connectionDevice === 'lan') { + testIP_and_FQDN_Format(config); + testPassword(config); + testPort(config); + resolve('Config seems to be valid for LAN.'); + } else if (config.connectionDevice === 'langw') { + testIP_and_FQDN_Format(config); + testPort(config); + resolve('Config seems to be valid for Serial-to-LAN-Gateway.'); + } else if (config.connectionDevice === 'dl2') { + testIP_and_FQDN_Format(config); + testPort(config); + testPassword(config); + resolve('Config seems to be valid for KM2/DL2.'); + } else if (config.connectionDevice === 'dl3') { + testIP_and_FQDN_Format(config); + testPort(config); + testPassword(config); + testChannel(config); + resolve('Config seems to be valid for DL3/DL2Plus.'); + /** + } else if (config.connectionDevice === 'inet') { + testPort(config); + testVBusIOFormat(config); + testPassword(config); + resolve('Config seems to be valid for KM2/DL2/DL3 via VBus.net.'); +**/ + } else { + reject('Config is invalid! Please select at least a connection device to get further tests - or even better, complete your whole config.'); + } + } + ); + } // Is called when databases are connected and adapter received configuration. async onReady() { + this.configIsValid(this.config) + .then(result => { + this.log.info(result); + this.main().then(null, err => { + this.log.error(err); + this.setState('info.connection', false, true); + }); + }) + .catch(err => { + this.log.error(err); + this.setStateAsync('info.connection', false, true); + return; + //this.terminate('Terminating Adapter until Configuration is completed', 11); + }); + + /** try { // Terminate adapter after first start because configuration is not yet received // Adapter is restarted automatically when config page is closed @@ -402,7 +570,9 @@ class MyVbus extends utils.Adapter { } } catch (error) { this.log.error(`[onReady] error: ${error.message}, stack: ${error.stack}`); - } + } + **/ + } // Create or extend object @@ -416,15 +586,6 @@ class MyVbus extends utils.Adapter { } }); } - - // Decrypt passwords - decrypt(key, value) { - let result = ''; - for (let i = 0; i < value.length; ++i) { - result += String.fromCharCode(key[i % key.length].charCodeAt(0) ^ value.charCodeAt(i)); - } - return result; - } // Exit adapter onUnload(callback) { diff --git a/package-lock.json b/package-lock.json index 53b89891..74a48881 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@alcalzone/release-script": "^3.7.0", "@alcalzone/release-script-plugin-iobroker": "^3.7.0", "@alcalzone/release-script-plugin-license": "^3.7.0", + "@alcalzone/release-script-plugin-manual-review": "^3.7.0", "@iobroker/adapter-dev": "^1.2.0", "@iobroker/testing": "^4.1.0", "@types/chai": "^4.3.11", @@ -240,6 +241,18 @@ "node": ">=12.20" } }, + "node_modules/@alcalzone/release-script-plugin-manual-review": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-manual-review/-/release-script-plugin-manual-review-3.7.0.tgz", + "integrity": "sha512-lU/KJHQpYhdDcYPxiR3X5BsP9O+bNYfyP8VPE5dF9fwLgTFklbGMOhF9VjdQMiZ8Cyr7fCH7ptw+oHw+UuQutQ==", + "dev": true, + "dependencies": { + "@alcalzone/release-script-core": "3.7.0" + }, + "engines": { + "node": ">=12.20" + } + }, "node_modules/@alcalzone/release-script-plugin-package": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-package/-/release-script-plugin-package-3.7.0.tgz", diff --git a/package.json b/package.json index 3c08689d..8d592f1b 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@alcalzone/release-script": "^3.7.0", "@alcalzone/release-script-plugin-iobroker": "^3.7.0", "@alcalzone/release-script-plugin-license": "^3.7.0", + "@alcalzone/release-script-plugin-manual-review": "^3.7.0", "@iobroker/adapter-dev": "^1.2.0", "@iobroker/testing": "^4.1.0", "@types/chai": "^4.3.11", @@ -55,7 +56,6 @@ "scripts": { "test:js": "mocha --opts test/mocha.custom.opts", "test:package": "mocha test/package --exit", - "test:unit": "mocha test/unit --exit", "test:integration": "mocha test/integration --exit", "test": "npm run test:js && npm run test:package", "lint": "npm run lint:js", diff --git a/test/unit.js b/test/unit.js deleted file mode 100644 index 58523da1..00000000 --- a/test/unit.js +++ /dev/null @@ -1,7 +0,0 @@ -const path = require('path'); -const { tests } = require('@iobroker/testing'); - -// Run unit tests - See https://github.com/ioBroker/testing for a detailed explanation and further options -tests.unit(path.join(__dirname, '..'), { - allowedExitCodes: [11] -});