From 60be53659960c68a266985ab29e47c2a61da888d Mon Sep 17 00:00:00 2001 From: Garfonso Date: Tue, 15 Oct 2024 13:15:46 +0200 Subject: [PATCH] new configuration and translations --- admin/i18n/de/translations.json | 46 +++-- admin/i18n/en/translations.json | 38 ++-- admin/i18n/es/translations.json | 54 +++--- admin/i18n/fr/translations.json | 52 +++--- admin/i18n/it/translations.json | 50 +++-- admin/i18n/nl/translations.json | 50 +++-- admin/i18n/pl/translations.json | 50 +++-- admin/i18n/pt/translations.json | 46 +++-- admin/i18n/ru/translations.json | 44 ++--- admin/i18n/uk/translations.json | 58 +++--- admin/i18n/zh-cn/translations.json | 52 +++--- admin/jsonConfig.json | 171 +++++++++++++++++ admin/words.js | 58 +++--- io-package.json | 17 +- lib/configConverter.js | 91 +++++++++ lib/gpioControl.js | 76 ++++---- main.js | 285 +++++++++++++---------------- 17 files changed, 705 insertions(+), 533 deletions(-) create mode 100644 admin/jsonConfig.json create mode 100644 lib/configConverter.js diff --git a/admin/i18n/de/translations.json b/admin/i18n/de/translations.json index 1bae6a3..d9b32dd 100644 --- a/admin/i18n/de/translations.json +++ b/admin/i18n/de/translations.json @@ -1,33 +1,29 @@ { - "Button debounce period (ms)": "Schaltflächen Entprellzeit (ms)", - "Button double click period (ms)": "Doppelklickzeit (ms)", - "Button long press period (ms)": "Taste lange Druckdauer (ms)", - "Buttons are wired pull up": "Die Tasten sind hochgezogen", "CPU": "CPU", - "Enable": "Aktivieren", - "Enabled": "Aktiviert", - "GPIOs": "GPIOs", - "Input debounce period (ms)": "Entprellungsperiode (ms) eingeben", - "Inputs are wired pull up": "Die Eingänge sind hochgezogen", - "Label": "Etikett", - "Memory": "Speicher", - "Minimum recommended is 2s. Set to zero to disable polling.": "Empfohlenes Minimum ist 2s. Auf Null setzen, um die Abfrage zu deaktivieren.", - "Network": "Netzwerk", - "Poll": "Pollen", - "Polling interval for DHTxx/AM23xx devices (ms)": "Abfrageintervall für DHTxx / AM23xx-Geräte (ms)", - "Port": "Port", - "Port numbers relate to Broadcom SOC channel, not physical pins.": "Die Portnummern beziehen sich auf den Broadcom SOC-Kanal, nicht auf physische Pins.", - "RPI-Monitor Adapter settings": "RPI-Monitor Adapter-Einstellungen", "Raspberry": "Raspberry", - "SDCard": "SD Karte", + "Memory": "Memory", + "Network": "Network", + "SDCard": "SD Card", "Swap": "Swap", - "Temperature": "Temperatur", - "Type": "Typ", + "Temperature": "Temperature", "Uptime": "Uptime", "WLAN": "WLAN", - "button": "Taste mit Klick, Doppelklick, langem Drücken usw.", + "MonitoringExplanation": "Wählen Sie aus, welche Elemente überwacht werden sollen. Sie werden regelmäßig befragt und bei Bedarf werden Zustände erstellt.", + "Monitoring": "Überwachung", + "GPIOs": "GPIOs", + "GPIOConfigExplanation": "Fügen Sie hier GPIO-Konfigurationen hinzu. Drücken Sie auf +, wählen Sie Eingabe oder Ausgabe aus und so weiter. Portnummern beziehen sich auf den Broadcom SOC-Kanal, nicht auf physische Pins. Geben Sie für Eingaben eine Entprellzeit in Millisekunden in die Spalte „Entprellung/Abfrage“ ein. Bei DHT11/22-Temperatursensoren ist der Wert in dieser Spalte das Abfrageintervall.", + "pullupwarning": "ACHTUNG: Pull-Up/Pull-Down wird derzeit nicht wirklich unterstützt. Es sollte in der Zukunft sein, aber es war nie in der Vergangenheit. Achten Sie darauf, dass nichts kaputt geht.", + "GPIO Number": "GPIO-Nummer", + "Type": "Typ", "in": "Eingang", - "out": "Ausgang", - "outhigh": "Ausgang, Startwert 1", - "outlow": "Ausgang, Startwert 0" + "out": "Ausgabe", + "outhigh": "Ausgabe, Anfangswert 1", + "outlow": "Ausgabe, Anfangswert 0", + "DHT11": "DHT11 Temperatur- und Feuchtigkeitssensor", + "DHT22": "DHT22/AM23xx Temperatur- und Feuchtigkeitssensor", + "Debounce / Poll (ms)": "Entprellung / Abfrage (ms)", + "Pull Up": "Hochziehen", + "Pull Down": "Nach unten ziehen", + "Label": "Beschriftung", + "GPIOVauleERRORText": "Fehler: GPIO Nummer darf nicht leer sein, muss eindeutig sein und zwischen 2 und 27 liegen." } diff --git a/admin/i18n/en/translations.json b/admin/i18n/en/translations.json index 2e71b20..b5cf367 100644 --- a/admin/i18n/en/translations.json +++ b/admin/i18n/en/translations.json @@ -1,37 +1,29 @@ { - "Button debounce period (ms)": "Button debounce period (ms)", - "Button double click period (ms)": "Button double click period (ms)", - "Button long press period (ms)": "Button long press period (ms)", - "Buttons are wired pull up": "Buttons are wired pull up", "CPU": "CPU", - "Enable": "Enable", - "Enabled": "Enabled", - "GPIOs": "GPIOs", - "Input debounce period (ms)": "Input debounce period (ms)", - "Inputs are wired pull up": "Inputs are wired pull up", - "Label": "Label", + "Raspberry": "Raspberry", "Memory": "Memory", - "Minimum recommended is 2s. Set to zero to disable polling.": "Minimum recommended is 2s. Set to zero to disable polling.", "Network": "Network", - "Poll": "Poll", - "Polling interval for DHTxx/AM23xx devices (ms)": "Polling interval for DHTxx/AM23xx devices (ms)", - "Port": "Port", - "Port numbers relate to Broadcom SOC channel, not physical pins.": "Port numbers relate to Broadcom SOC channel, not physical pins.", - "RPI-Monitor Adapter settings": "RPI-Monitor Adapter settings", - "Raspberry": "Raspberry", "SDCard": "SD Card", "Swap": "Swap", "Temperature": "Temperature", - "Type": "Type", "Uptime": "Uptime", "WLAN": "WLAN", - "button": "Button with click, double-click, long press, etc.", + "MonitoringExplanation": "Select which elements to monitor. They will be polled on a regular basis and states will be created as needed.", + "Monitoring": "Monitoring", + "GPIOs": "GPIOs", + "GPIOConfigExplanation": "Add GPIO configurations here. Press on +, select if input or output and so on. Port numbers relate to Broadcom SOC channel, not physical pins. For inputs enter a debounce time in milliseconds into the Debounce / Poll column. For DHT11/22 Temperature sensors, the value in that column will be the poll interval.", + "pullupwarning": "WARNING: Pull up / Pull down is not really supported, currently. It should be in future, but it never was in the past. Be sure not to break anything.", + "GPIO Number": "GPIO Number", + "Type": "Type", "in": "Input", "out": "Output", "outhigh": "Output, initial value 1", "outlow": "Output, initial value 0", - "GPIOConfigExplanation": "Add GPIO configurations here. Press on +, select if input or output and so on. Port numbers relate to Broadcom SOC channel, not physical pins. For inputs enter a debounce time in milliseconds into the Debounce / Poll column. For DHT11/22 Temperature sensors, the value in that column will be the poll interval.", - "MonitoringExplanation": "Select which elements to monitor. They will be polled on a regular basis and states will be created as needed.", - "pullupwarning": "WARNING: Pull up / Pull down is not really supported, currently. It should be in future, but it never was in the past. Be sure not to break anything.", - "GPIOVauleERRORText": "Error: GPIO must not be empty, must be unique and between 2 and 27." + "DHT11": "DHT11 Temperatur and Humidity Sensor", + "DHT22": "DHT22/AM23xx Temperatur and Humidity Sensor", + "Debounce / Poll (ms)": "Debounce / Poll (ms)", + "Pull Up": "Pull Up", + "Pull Down": "Pull Down", + "Label": "Label", + "GPIOVauleERRORText": "Error: GPIO Number must not be empty, must be unique and between 2 and 27." } diff --git a/admin/i18n/es/translations.json b/admin/i18n/es/translations.json index 9c280b1..873cab5 100644 --- a/admin/i18n/es/translations.json +++ b/admin/i18n/es/translations.json @@ -1,33 +1,29 @@ { - "Button debounce period (ms)": "Período de rebote del botón (ms)", - "Button double click period (ms)": "Período de doble clic del botón (ms)", - "Button long press period (ms)": "Período de pulsación prolongada del botón (ms)", - "Buttons are wired pull up": "Los botones están conectados con cable", - "CPU": "UPC", - "Enable": "Habilitar", - "Enabled": "Habilitado", - "GPIOs": "GPIOs", - "Input debounce period (ms)": "Período de antirrebote de entrada (ms)", - "Inputs are wired pull up": "Las entradas están cableadas", - "Label": "Etiqueta", - "Memory": "Memoria", - "Minimum recommended is 2s. Set to zero to disable polling.": "El mínimo recomendado es 2 s. Establecer en cero para deshabilitar el sondeo.", - "Network": "Red", - "Poll": "Encuesta", - "Polling interval for DHTxx/AM23xx devices (ms)": "Intervalo de sondeo para dispositivos DHTxx / AM23xx (ms)", - "Port": "Puerto", - "Port numbers relate to Broadcom SOC channel, not physical pins.": "Los números de puerto se refieren al canal Broadcom SOC, no a los pines físicos.", - "RPI-Monitor Adapter settings": "Configuración del adaptador RPI-Monitor", - "Raspberry": "Frambuesa", - "SDCard": "Tarjeta SD", - "Swap": "Intercambiar", - "Temperature": "Temperatura", - "Type": "Tipo", - "Uptime": "Tiempo de actividad", + "CPU": "CPU", + "Raspberry": "Raspberry", + "Memory": "Memory", + "Network": "Network", + "SDCard": "SD Card", + "Swap": "Swap", + "Temperature": "Temperature", + "Uptime": "Uptime", "WLAN": "WLAN", - "button": "Botón con clic, doble clic, pulsación larga, etc.", - "in": "Entrada", - "out": "Salida", + "MonitoringExplanation": "Seleccione qué elementos monitorear. Serán encuestados periódicamente y se crearán estados según sea necesario.", + "Monitoring": "Escucha", + "GPIOs": "GPIO", + "GPIOConfigExplanation": "Agregue configuraciones GPIO aquí. Presione +, seleccione si es entrada o salida, etc. Los números de puerto se relacionan con el canal SOC de Broadcom, no con los pines físicos. Para las entradas, ingrese un tiempo de rebote en milisegundos en la columna Antirrebote/Encuesta. Para los sensores de temperatura DHT11/22, el valor en esa columna será el intervalo de sondeo.", + "pullupwarning": "ADVERTENCIA: Pull up / Pull down no es realmente compatible actualmente. Debería serlo en el futuro, pero nunca lo fue en el pasado. Asegúrate de no romper nada.", + "GPIO Number": "Número GPIO", + "Type": "Tipo", + "in": "Aporte", + "out": "Producción", "outhigh": "Salida, valor inicial 1", - "outlow": "Salida, valor inicial 0" + "outlow": "Salida, valor inicial 0", + "DHT11": "Sensor de temperatura y humedad DHT11", + "DHT22": "Sensor de temperatura y humedad DHT22/AM23xx", + "Debounce / Poll (ms)": "Antirrebote / Encuesta (ms)", + "Pull Up": "Levantar", + "Pull Down": "Derribar", + "Label": "Etiqueta", + "GPIOVauleERRORText": "Error: el número GPIO no debe estar vacío, debe ser único y estar entre 2 y 27." } diff --git a/admin/i18n/fr/translations.json b/admin/i18n/fr/translations.json index 791364c..401066e 100644 --- a/admin/i18n/fr/translations.json +++ b/admin/i18n/fr/translations.json @@ -1,33 +1,29 @@ { - "Button debounce period (ms)": "Période anti-rebond du bouton (ms)", - "Button double click period (ms)": "Période de double clic sur le bouton (ms)", - "Button long press period (ms)": "Période de pression longue du bouton (ms)", - "Buttons are wired pull up": "Les boutons sont tirés vers le haut", "CPU": "CPU", - "Enable": "Activer", - "Enabled": "Activée", - "GPIOs": "GPIO", - "Input debounce period (ms)": "Période anti-rebond d'entrée (ms)", - "Inputs are wired pull up": "Les entrées sont câblées vers le haut", - "Label": "Étiquette", - "Memory": "Mémoire", - "Minimum recommended is 2s. Set to zero to disable polling.": "Le minimum recommandé est de 2 s. Réglez sur zéro pour désactiver l'interrogation.", - "Network": "Réseau", - "Poll": "Sondage", - "Polling interval for DHTxx/AM23xx devices (ms)": "Intervalle d'interrogation pour les appareils DHTxx / AM23xx (ms)", - "Port": "Port", - "Port numbers relate to Broadcom SOC channel, not physical pins.": "Les numéros de port concernent le canal SOC Broadcom, pas les broches physiques.", - "RPI-Monitor Adapter settings": "Paramètres de l'adaptateur RPI-Monitor", - "Raspberry": "Framboise", - "SDCard": "Carte SD", - "Swap": "Échanger", - "Temperature": "Température", - "Type": "Type", - "Uptime": "Temps de disponibilité", + "Raspberry": "Raspberry", + "Memory": "Memory", + "Network": "Network", + "SDCard": "SD Card", + "Swap": "Swap", + "Temperature": "Temperature", + "Uptime": "Uptime", "WLAN": "WLAN", - "button": "Bouton avec clic, double-clic, appui long, etc.", - "in": "Entrée", - "out": "Sortie", + "MonitoringExplanation": "Sélectionnez les éléments à surveiller. Ils seront interrogés régulièrement et des États seront créés selon les besoins.", + "Monitoring": "Surveillance", + "GPIOs": "GPIO", + "GPIOConfigExplanation": "Ajoutez des configurations GPIO ici. Appuyez sur +, sélectionnez si entrée ou sortie et ainsi de suite. Les numéros de port concernent le canal Broadcom SOC et non les broches physiques. Pour les entrées, entrez un temps anti-rebond en millisecondes dans la colonne Anti-rebond / Sondage. Pour les capteurs de température DHT11/22, la valeur dans cette colonne sera l'intervalle d'interrogation.", + "pullupwarning": "AVERTISSEMENT : Pull up / Pull down n'est pas vraiment pris en charge actuellement. Cela devrait être le cas dans le futur, mais cela ne l’a jamais été dans le passé. Assurez-vous de ne rien casser.", + "GPIO Number": "Numéro GPIO", + "Type": "Taper", + "in": "Saisir", + "out": "Sortir", "outhigh": "Sortie, valeur initiale 1", - "outlow": "Sortie, valeur initiale 0" + "outlow": "Sortie, valeur initiale 0", + "DHT11": "Capteur de température et d'humidité DHT11", + "DHT22": "Capteur de température et d'humidité DHT22/AM23xx", + "Debounce / Poll (ms)": "Anti-rebond / Sondage (ms)", + "Pull Up": "Tirer vers le haut", + "Pull Down": "Abattre", + "Label": "Étiquette", + "GPIOVauleERRORText": "Erreur : Le numéro GPIO ne doit pas être vide, doit être unique et compris entre 2 et 27." } diff --git a/admin/i18n/it/translations.json b/admin/i18n/it/translations.json index be87fe5..cdcf389 100644 --- a/admin/i18n/it/translations.json +++ b/admin/i18n/it/translations.json @@ -1,33 +1,29 @@ { - "Button debounce period (ms)": "Periodo antirimbalzo pulsante (ms)", - "Button double click period (ms)": "Periodo di doppio clic del pulsante (ms)", - "Button long press period (ms)": "Periodo di pressione prolungata del pulsante (ms)", - "Buttons are wired pull up": "I pulsanti sono cablati pull up", - "CPU": "Processore", - "Enable": "Abilitare", - "Enabled": "Abilitato", - "GPIOs": "GPIO", - "Input debounce period (ms)": "Periodo antirimbalzo ingresso (ms)", - "Inputs are wired pull up": "Gli ingressi sono cablati pull up", - "Label": "Etichetta", - "Memory": "Memoria", - "Minimum recommended is 2s. Set to zero to disable polling.": "Il minimo consigliato è di 2 secondi. Impostare a zero per disabilitare il polling.", - "Network": "Rete locale", - "Poll": "Sondaggio", - "Polling interval for DHTxx/AM23xx devices (ms)": "Intervallo di polling per dispositivi DHTxx / AM23xx (ms)", - "Port": "Porta", - "Port numbers relate to Broadcom SOC channel, not physical pins.": "I numeri di porta si riferiscono al canale SOC Broadcom, non ai pin fisici.", - "RPI-Monitor Adapter settings": "Impostazioni dell'adattatore RPI-Monitor", + "CPU": "CPU", "Raspberry": "Raspberry", - "SDCard": "Scheda SD", - "Swap": "Scambiare", - "Temperature": "Temperatura", - "Type": "Genere", - "Uptime": "Tempo di attività", + "Memory": "Memory", + "Network": "Network", + "SDCard": "SD Card", + "Swap": "Swap", + "Temperature": "Temperature", + "Uptime": "Uptime", "WLAN": "WLAN", - "button": "Pulsante con clic, doppio clic, pressione prolungata, ecc.", + "MonitoringExplanation": "Seleziona quali elementi monitorare. Saranno sottoposti a votazioni su base regolare e gli stati verranno creati secondo necessità.", + "Monitoring": "Monitoraggio", + "GPIOs": "GPIO", + "GPIOConfigExplanation": "Aggiungi le configurazioni GPIO qui. Premere su +, selezionare se ingresso o uscita e così via. I numeri di porta si riferiscono al canale SOC Broadcom, non ai pin fisici. Per gli input inserire un tempo di antirimbalzo in millisecondi nella colonna Antirimbalzo/Poll. Per i sensori di temperatura DHT11/22, il valore in quella colonna sarà l'intervallo di poll.", + "pullupwarning": "ATTENZIONE: Pull up/Pull down non è attualmente supportato. Dovrebbe essere nel futuro, ma non lo è mai stato nel passato. Assicurati di non rompere nulla.", + "GPIO Number": "Numero GPIO", + "Type": "Tipo", "in": "Ingresso", - "out": "Uscita", + "out": "Produzione", "outhigh": "Uscita, valore iniziale 1", - "outlow": "Uscita, valore iniziale 0" + "outlow": "Uscita, valore iniziale 0", + "DHT11": "Sensore di temperatura e umidità DHT11", + "DHT22": "Sensore di temperatura e umidità DHT22/AM23xx", + "Debounce / Poll (ms)": "Rimbalzo/Poll (ms)", + "Pull Up": "Tirati su", + "Pull Down": "Tirare giù", + "Label": "Etichetta", + "GPIOVauleERRORText": "Errore: il numero GPIO non deve essere vuoto, deve essere univoco e compreso tra 2 e 27." } diff --git a/admin/i18n/nl/translations.json b/admin/i18n/nl/translations.json index b5103b0..58f26c9 100644 --- a/admin/i18n/nl/translations.json +++ b/admin/i18n/nl/translations.json @@ -1,33 +1,29 @@ { - "Button debounce period (ms)": "Knop debounce-periode (ms)", - "Button double click period (ms)": "Knop dubbelklikperiode (ms)", - "Button long press period (ms)": "Knop lang indrukken (ms)", - "Buttons are wired pull up": "Knopen zijn bedraad omhoog te trekken", "CPU": "CPU", - "Enable": "Inschakelen", - "Enabled": "Ingeschakeld", - "GPIOs": "GPIOs", - "Input debounce period (ms)": "Invoer debounce-periode (ms)", - "Inputs are wired pull up": "Ingangen zijn bedraad pull-up", - "Label": "Label", - "Memory": "Geheugen", - "Minimum recommended is 2s. Set to zero to disable polling.": "Minimaal aanbevolen is 2 sec. Stel in op nul om polling uit te schakelen.", - "Network": "Netwerk", - "Poll": "poll", - "Polling interval for DHTxx/AM23xx devices (ms)": "Polling-interval voor DHTxx / AM23xx-apparaten (ms)", - "Port": "Haven", - "Port numbers relate to Broadcom SOC channel, not physical pins.": "Poortnummers hebben betrekking op het Broadcom SOC-kanaal, niet op fysieke pinnen.", - "RPI-Monitor Adapter settings": "RPI-Monitor Adapter-instellingen", - "Raspberry": "Framboos", - "SDCard": "SD-kaart", - "Swap": "ruil", - "Temperature": "Temperatuur", - "Type": "Type", + "Raspberry": "Raspberry", + "Memory": "Memory", + "Network": "Network", + "SDCard": "SD Card", + "Swap": "Swap", + "Temperature": "Temperature", "Uptime": "Uptime", "WLAN": "WLAN", - "button": "Knop met klikken, dubbelklikken, lang indrukken, etc.", - "in": "Ingang", - "out": "Uitgang", + "MonitoringExplanation": "Selecteer welke elementen u wilt monitoren. Zij zullen op regelmatige basis worden ondervraagd en indien nodig zullen er staten worden opgericht.", + "Monitoring": "Toezicht", + "GPIOs": "GPIO's", + "GPIOConfigExplanation": "Voeg hier GPIO-configuraties toe. Druk op +, selecteer of invoer of uitvoer enzovoort. Poortnummers hebben betrekking op het Broadcom SOC-kanaal, niet op fysieke pinnen. Voer voor invoer een debouncetijd in milliseconden in de kolom Debounce / Poll in. Voor DHT11/22-temperatuursensoren is de waarde in die kolom het poll-interval.", + "pullupwarning": "WAARSCHUWING: Pull up / Pull down wordt momenteel niet echt ondersteund. Het zou in de toekomst moeten gebeuren, maar dat is in het verleden nooit zo geweest. Zorg ervoor dat je niets kapot maakt.", + "GPIO Number": "GPIO-nummer", + "Type": "Type", + "in": "Invoer", + "out": "Uitvoer", "outhigh": "Uitgang, beginwaarde 1", - "outlow": "Uitgang, beginwaarde 0" + "outlow": "Uitgang, beginwaarde 0", + "DHT11": "DHT11 temperatuur- en vochtigheidssensor", + "DHT22": "DHT22/AM23xx temperatuur- en vochtigheidssensor", + "Debounce / Poll (ms)": "Debounce/peiling (ms)", + "Pull Up": "Trek omhoog", + "Pull Down": "Trek naar beneden", + "Label": "Label", + "GPIOVauleERRORText": "Fout: GPIO-nummer mag niet leeg zijn, moet uniek zijn en tussen 2 en 27 liggen." } diff --git a/admin/i18n/pl/translations.json b/admin/i18n/pl/translations.json index 5708c00..561d938 100644 --- a/admin/i18n/pl/translations.json +++ b/admin/i18n/pl/translations.json @@ -1,33 +1,29 @@ { - "Button debounce period (ms)": "Okres odbijania przycisku (ms)", - "Button double click period (ms)": "Okres podwójnego kliknięcia przycisku (ms)", - "Button long press period (ms)": "Długie naciśnięcie przycisku (ms)", - "Buttons are wired pull up": "Przyciski są na drutach podciągane", - "CPU": "procesor", - "Enable": "Włączyć", - "Enabled": "Włączone", - "GPIOs": "GPIOs", - "Input debounce period (ms)": "Okres odbicia wejściowego (ms)", - "Inputs are wired pull up": "Wejścia są przewodowe podciągane", - "Label": "Etykieta", - "Memory": "Pamięć", - "Minimum recommended is 2s. Set to zero to disable polling.": "Zalecane minimum to 2 s. Ustaw na zero, aby wyłączyć odpytywanie.", - "Network": "Sieć", - "Poll": "Zapytanie", - "Polling interval for DHTxx/AM23xx devices (ms)": "Okres odpytywania dla urządzeń DHTxx / AM23xx (ms)", - "Port": "Port", - "Port numbers relate to Broadcom SOC channel, not physical pins.": "Numery portów odnoszą się do kanału Broadcom SOC, a nie fizycznych pinów.", - "RPI-Monitor Adapter settings": "Ustawienia adaptera RPI-Monitor", - "Raspberry": "Malina", - "SDCard": "Karta SD", - "Swap": "Zamiana", - "Temperature": "Temperatura", - "Type": "Typ", - "Uptime": "Czas pracy", + "CPU": "CPU", + "Raspberry": "Raspberry", + "Memory": "Memory", + "Network": "Network", + "SDCard": "SD Card", + "Swap": "Swap", + "Temperature": "Temperature", + "Uptime": "Uptime", "WLAN": "WLAN", - "button": "Przycisk z kliknięciem, podwójnym kliknięciem, długim naciśnięciem itp.", + "MonitoringExplanation": "Wybierz elementy do monitorowania. Będą one regularnie ankietowane, a stany będą tworzone w miarę potrzeb.", + "Monitoring": "Monitorowanie", + "GPIOs": "GPIO", + "GPIOConfigExplanation": "Dodaj tutaj konfiguracje GPIO. Naciśnij +, wybierz wejście lub wyjście i tak dalej. Numery portów odnoszą się do kanału Broadcom SOC, a nie do fizycznych pinów. W przypadku wejść wprowadź czas odbicia w milisekundach w kolumnie Odbicie/odpytywanie. Dla czujników temperatury DHT11/22 wartość w tej kolumnie będzie interwałem odpytywania.", + "pullupwarning": "OSTRZEŻENIE: Funkcja podciągania i opuszczania nie jest obecnie obsługiwana. Powinno to nastąpić w przyszłości, ale nigdy tak nie było w przeszłości. Pamiętaj, aby niczego nie złamać.", + "GPIO Number": "Numer GPIO", + "Type": "Typ", "in": "Wejście", "out": "Wyjście", "outhigh": "Wyjście, wartość początkowa 1", - "outlow": "Wyjście, wartość początkowa 0" + "outlow": "Wyjście, wartość początkowa 0", + "DHT11": "Czujnik temperatury i wilgotności DHT11", + "DHT22": "Czujnik temperatury i wilgotności DHT22/AM23xx", + "Debounce / Poll (ms)": "Odrzucenie/ankieta (ms)", + "Pull Up": "Zatrzymać się", + "Pull Down": "Rozbierać", + "Label": "Etykieta", + "GPIOVauleERRORText": "Błąd: Numer GPIO nie może być pusty, musi być unikalny i zawierać się w przedziale od 2 do 27." } diff --git a/admin/i18n/pt/translations.json b/admin/i18n/pt/translations.json index 3d2d9b4..80f272d 100644 --- a/admin/i18n/pt/translations.json +++ b/admin/i18n/pt/translations.json @@ -1,33 +1,29 @@ { - "Button debounce period (ms)": "Período de debounce do botão (ms)", - "Button double click period (ms)": "Período de duplo clique do botão (ms)", - "Button long press period (ms)": "Período de pressão longa do botão (ms)", - "Buttons are wired pull up": "Os botões são puxados para cima", "CPU": "CPU", - "Enable": "Habilitar", - "Enabled": "ativado", + "Raspberry": "Raspberry", + "Memory": "Memory", + "Network": "Network", + "SDCard": "SD Card", + "Swap": "Swap", + "Temperature": "Temperature", + "Uptime": "Uptime", + "WLAN": "WLAN", + "MonitoringExplanation": "Selecione quais elementos monitorar. Eles serão pesquisados ​​regularmente e estados serão criados conforme necessário.", + "Monitoring": "Monitoramento", "GPIOs": "GPIOs", - "Input debounce period (ms)": "Período de debounce de entrada (ms)", - "Inputs are wired pull up": "As entradas são conectadas pull up", - "Label": "Rótulo", - "Memory": "Memória", - "Minimum recommended is 2s. Set to zero to disable polling.": "O mínimo recomendado é 2s. Defina como zero para desativar a pesquisa.", - "Network": "Rede", - "Poll": "Votação", - "Polling interval for DHTxx/AM23xx devices (ms)": "Intervalo de pesquisa para dispositivos DHTxx / AM23xx (ms)", - "Port": "Porta", - "Port numbers relate to Broadcom SOC channel, not physical pins.": "Os números das portas estão relacionados ao canal Broadcom SOC, não aos pinos físicos.", - "RPI-Monitor Adapter settings": "Configurações do adaptador RPI-Monitor", - "Raspberry": "Framboesa", - "SDCard": "Cartão SD", - "Swap": "Troca", - "Temperature": "Temperatura", + "GPIOConfigExplanation": "Adicione configurações GPIO aqui. Pressione +, selecione se é entrada ou saída e assim por diante. Os números das portas estão relacionados ao canal SOC da Broadcom, não aos pinos físicos. Para entradas, insira um tempo de rejeição em milissegundos na coluna Debounce/Poll. Para sensores de temperatura DHT11/22, o valor nessa coluna será o intervalo de pesquisa.", + "pullupwarning": "AVISO: Pull up / Pull down não é realmente suportado atualmente. Deveria estar no futuro, mas nunca esteve no passado. Certifique-se de não quebrar nada.", + "GPIO Number": "Número GPIO", "Type": "Tipo", - "Uptime": "Tempo de atividade", - "WLAN": "WLAN", - "button": "Botão com clique, clique duplo, toque longo, etc.", "in": "Entrada", "out": "Saída", "outhigh": "Saída, valor inicial 1", - "outlow": "Saída, valor inicial 0" + "outlow": "Saída, valor inicial 0", + "DHT11": "Sensor de temperatura e umidade DHT11", + "DHT22": "Sensor de temperatura e umidade DHT22/AM23xx", + "Debounce / Poll (ms)": "Debounce/Enquete (ms)", + "Pull Up": "Puxe para cima", + "Pull Down": "Puxar para baixo", + "Label": "Rótulo", + "GPIOVauleERRORText": "Erro: o número GPIO não deve estar vazio, deve ser único e estar entre 2 e 27." } diff --git a/admin/i18n/ru/translations.json b/admin/i18n/ru/translations.json index 111bd3f..8bbaa6a 100644 --- a/admin/i18n/ru/translations.json +++ b/admin/i18n/ru/translations.json @@ -1,33 +1,29 @@ { - "Button debounce period (ms)": "Период устранения дребезга кнопки (мс)", - "Button double click period (ms)": "Период двойного нажатия кнопки (мс)", - "Button long press period (ms)": "Длительность нажатия кнопки (мс)", - "Buttons are wired pull up": "Кнопки проводные подтягиваются вверх", - "CPU": "Процессор", - "Enable": "включить", - "Enabled": "Активен", - "GPIOs": "GPIO Порты", - "Input debounce period (ms)": "Входной период устранения дребезга (мс)", - "Inputs are wired pull up": "Входы подключены подтягивающе", - "Label": "этикетка", - "Memory": "Память", - "Minimum recommended is 2s. Set to zero to disable polling.": "Рекомендуемый минимум - 2 секунды. Установите в ноль, чтобы отключить опрос.", - "Network": "Сеть", - "Poll": "Опрашивать", - "Polling interval for DHTxx/AM23xx devices (ms)": "Интервал опроса для устройств DHTxx / AM23xx (мс)", - "Port": "Порт", - "Port numbers relate to Broadcom SOC channel, not physical pins.": "Номера портов относятся к каналу Broadcom SOC, а не к физическим контактам.", - "RPI-Monitor Adapter settings": "Настройки RPI-монитор адаптера", + "CPU": "CPU", "Raspberry": "Raspberry", - "SDCard": "SD Карта", + "Memory": "Memory", + "Network": "Network", + "SDCard": "SD Card", "Swap": "Swap", - "Temperature": "Температура", - "Type": "Тип", + "Temperature": "Temperature", "Uptime": "Uptime", "WLAN": "WLAN", - "button": "Кнопка с щелчком, двойным щелчком, долгим нажатием и т. Д.", + "MonitoringExplanation": "Выберите, какие элементы отслеживать. Они будут регулярно опрашиваться и по мере необходимости создаваться штаты.", + "Monitoring": "Мониторинг", + "GPIOs": "GPIO", + "GPIOConfigExplanation": "Добавьте сюда конфигурации GPIO. Нажмите +, выберите вход или выход и так далее. Номера портов относятся к каналу Broadcom SOC, а не к физическим контактам. В качестве входных данных введите время устранения дребезга в миллисекундах в столбце «Устранение дребезга/опрос». Для датчиков температуры DHT11/22 значением в этом столбце будет интервал опроса.", + "pullupwarning": "ВНИМАНИЕ: Pull up/Pull down в настоящее время не поддерживается. Это должно быть в будущем, но этого никогда не было в прошлом. Будьте уверены, чтобы ничего не сломать.", + "GPIO Number": "Номер GPIO", + "Type": "Тип", "in": "Вход", "out": "Выход", "outhigh": "Выход, начальное значение 1", - "outlow": "Выход, начальное значение 0" + "outlow": "Выход, начальное значение 0", + "DHT11": "DHT11 Датчик температуры и влажности", + "DHT22": "DHT22/AM23xx Датчик температуры и влажности", + "Debounce / Poll (ms)": "Отказ/опрос (мс)", + "Pull Up": "Остановить", + "Pull Down": "Потянуть вниз", + "Label": "Этикетка", + "GPIOVauleERRORText": "Ошибка: номер GPIO не должен быть пустым, должен быть уникальным и находиться в диапазоне от 2 до 27." } diff --git a/admin/i18n/uk/translations.json b/admin/i18n/uk/translations.json index c0be106..9bfeeda 100644 --- a/admin/i18n/uk/translations.json +++ b/admin/i18n/uk/translations.json @@ -1,33 +1,29 @@ { - "Button debounce period (ms)": "", - "Button double click period (ms)": "", - "Button long press period (ms)": "", - "Buttons are wired pull up": "", - "CPU": "", - "Enable": "", - "Enabled": "", - "GPIOs": "", - "Input debounce period (ms)": "", - "Inputs are wired pull up": "", - "Label": "", - "Memory": "", - "Minimum recommended is 2s. Set to zero to disable polling.": "", - "Network": "", - "Poll": "", - "Polling interval for DHTxx/AM23xx devices (ms)": "", - "Port": "", - "Port numbers relate to Broadcom SOC channel, not physical pins.": "", - "RPI-Monitor Adapter settings": "", - "Raspberry": "", - "SDCard": "", - "Swap": "", - "Temperature": "", - "Type": "", - "Uptime": "", - "WLAN": "", - "button": "", - "in": "", - "out": "", - "outhigh": "", - "outlow": "" + "CPU": "CPU", + "Raspberry": "Raspberry", + "Memory": "Memory", + "Network": "Network", + "SDCard": "SD Card", + "Swap": "Swap", + "Temperature": "Temperature", + "Uptime": "Uptime", + "WLAN": "WLAN", + "MonitoringExplanation": "Виберіть елементи для моніторингу. Їх опитуватимуть на регулярній основі, а за потреби створюватимуть штати.", + "Monitoring": "Моніторинг", + "GPIOs": "GPIO", + "GPIOConfigExplanation": "Додайте сюди конфігурації GPIO. Натисніть +, виберіть вхід чи вихід і так далі. Номери портів стосуються каналу Broadcom SOC, а не фізичних контактів. Для вхідних даних введіть час усунення дребезгу в мілісекундах у стовпці Усунення дребезгу/опитування. Для датчиків температури DHT11/22 значення в цьому стовпці буде інтервалом опитування.", + "pullupwarning": "ПОПЕРЕДЖЕННЯ: наразі функція Pull up / Pull down не підтримується. Це має бути в майбутньому, але цього ніколи не було в минулому. Стежте, щоб нічого не зламати.", + "GPIO Number": "Номер GPIO", + "Type": "Тип", + "in": "Введення", + "out": "Вихід", + "outhigh": "Вихід, початкове значення 1", + "outlow": "Вихід, початкове значення 0", + "DHT11": "Датчик температури та вологості DHT11", + "DHT22": "DHT22/AM23xx Датчик температури та вологості", + "Debounce / Poll (ms)": "Відбій/опитування (мс)", + "Pull Up": "Підтягнутись", + "Pull Down": "Потягніть вниз", + "Label": "Мітка", + "GPIOVauleERRORText": "Помилка: номер GPIO не має бути порожнім, має бути унікальним і мати значення від 2 до 27." } diff --git a/admin/i18n/zh-cn/translations.json b/admin/i18n/zh-cn/translations.json index a3f213e..4a178a6 100644 --- a/admin/i18n/zh-cn/translations.json +++ b/admin/i18n/zh-cn/translations.json @@ -1,33 +1,29 @@ { - "Button debounce period (ms)": "按钮反跳周期(毫秒)", - "Button double click period (ms)": "按钮双击时间(毫秒)", - "Button long press period (ms)": "按钮长按周期(毫秒)", - "Buttons are wired pull up": "按钮有线拉起", "CPU": "CPU", - "Enable": "启用", - "Enabled": "启用", - "GPIOs": "Gpio", - "Input debounce period (ms)": "输入去抖动周期(毫秒)", - "Inputs are wired pull up": "输入有线上拉", - "Label": "标签", - "Memory": "存储器", - "Minimum recommended is 2s. Set to zero to disable polling.": "推荐的最小值为2秒。设置为零可禁用轮询。", - "Network": "网络", - "Poll": "轮询", - "Polling interval for DHTxx/AM23xx devices (ms)": "DHTxx / AM23xx设备的轮询间隔(ms)", - "Port": "端口", - "Port numbers relate to Broadcom SOC channel, not physical pins.": "端口号与Broadcom SOC通道有关,与物理引脚无关。", - "RPI-Monitor Adapter settings": "RPI-监视器的设置", - "Raspberry": "树莓", - "SDCard": "SD卡", - "Swap": "交换", - "Temperature": "温度", - "Type": "类型", - "Uptime": "正常运行时间", + "Raspberry": "Raspberry", + "Memory": "Memory", + "Network": "Network", + "SDCard": "SD Card", + "Swap": "Swap", + "Temperature": "Temperature", + "Uptime": "Uptime", "WLAN": "WLAN", - "button": "单击,双击,长按等按钮", - "in": "在", - "out": "出来", + "MonitoringExplanation": "选择要监视的元素。他们将定期接受民意调查,并根据需要创建州。", + "Monitoring": "监控", + "GPIOs": "GPIO", + "GPIOConfigExplanation": "此处添加 GPIO 配置。按+,选择输入或输出等。端口号与 Broadcom SOC 通道相关,与物理引脚无关。对于输入,请在“去抖/轮询”列中输入以毫秒为单位的去抖时间。对于 DHT11/22 温度传感器,该列中的值将是轮询间隔。", + "pullupwarning": "警告:目前并不真正支持上拉/下拉。它应该是在未来,但它从来不是在过去。确保不要破坏任何东西。", + "GPIO Number": "GPIO 数量", + "Type": "类型", + "in": "输入", + "out": "输出", "outhigh": "输出,初始值1", - "outlow": "输出,初始值0" + "outlow": "输出,初始值0", + "DHT11": "DHT11温湿度传感器", + "DHT22": "DHT22/AM23xx温湿度传感器", + "Debounce / Poll (ms)": "去抖/轮询(毫秒)", + "Pull Up": "拉起", + "Pull Down": "下拉", + "Label": "标签", + "GPIOVauleERRORText": "错误:GPIO 编号不能为空,必须唯一且介于 2 到 27 之间。" } diff --git a/admin/jsonConfig.json b/admin/jsonConfig.json new file mode 100644 index 0000000..d30fa49 --- /dev/null +++ b/admin/jsonConfig.json @@ -0,0 +1,171 @@ +{ + "i18n": true, + "type": "tabs", + "items": { + "_monitoring": { + "type": "tab", + "label": "Monitoring", + "items": { + "_explanation": { + "type": "staticText", + "text": "MonitoringExplanation", + "newLine": true + }, + "c_cpu": { + "type": "checkbox", + "label": "CPU", + "newLine": true + }, + "c_raspberry": { + "type": "checkbox", + "label": "Raspberry" + }, + "c_memory": { + "type": "checkbox", + "label": "Memory" + }, + "c_network": { + "type": "checkbox", + "label": "Network", + "newLine": true + }, + "c_sdcard": { + "type": "checkbox", + "label": "SDCard" + }, + "c_swap": { + "type": "checkbox", + "label": "Swap" + }, + "c_temperature": { + "type": "checkbox", + "label": "Temperature", + "newLine": true + }, + "c_uptime": { + "type": "checkbox", + "label": "Uptime" + }, + "c_wlan": { + "type": "checkbox", + "label": "WLAN" + } + } + }, + "_gpios": { + "type": "tab", + "label": "GPIOs", + "items": { + "_explanation": { + "type": "staticText", + "text": "GPIOConfigExplanation", + "newLine": true + }, + "_pullUpWarning": { + "type": "staticText", + "text": "pullupwarning", + "hidden": false, + "style": { + "color": "red", + "font-size": "larger" + }, + "newLine": true + }, + "gpioSettings": { + "type": "table", + "newLine": true, + "uniqueColumns": ["gpio"], + "validatorNoSaveOnError": true, + "validator": "if (!data.gpioSettings) return true; const values=[]; for(const r of data.gpioSettings) { if (!(r.gpio !== null && r.gpio !== '' && r.gpio >= 2 && r.gpio <= 27 && !values.includes(r.gpio))) {return false;} values.push(r.gpio); }; return true;", + "items": [ + { + "type": "number", + "attr": "gpio", + "title": "GPIO Number", + "tooltip": "Enter number of GPIO to configure", + "sort": true, + "filter": false, + "defaultFunc": "if (!data.gpioSettings) return 2; let def=1; for(const r of globalData.gpioSettings) {def = Math.max(def, r.gpio); }; return def+1;", + "min": 2, + "max": 27, + "step": 1, + "width": "5%", + "validator": "data.gpio !== null && data.gpio !== '' && data.gpio >= 2 && data.gpio <= 27 && globalData.gpioSettings.filter(r => r.gpio === data.gpio).length === 1" + }, + { + "type": "select", + "attr": "configuration", + "title": "Type", + "default": "out", + "options": [ + { + "value": "in", + "label": "in" + }, + { + "value": "out", + "label": "out" + }, + { + "value": "outhigh", + "label": "outhigh" + }, + { + "value": "outlow", + "label": "outlow" + }, + { + "value": "dht11", + "label": "DHT11" + }, + { + "value": "dht22", + "label": "DHT22" + } + ] + }, + { + "type": "number", + "attr": "debounceOrPoll", + "title": "Debounce / Poll (ms)", + "defaultFunc": "['dht11', 'dht22'].includes(data.configuration) ? 350 : 0", + "hidden": "!['in', 'dht11', 'dht22'].includes(data.configuration)", + "min": 0, + "step": 10 + }, + { + "type": "checkbox", + "attr": "pullUp", + "title": "Pull Up", + "hidden": "data.configuration !== 'in'", + "default": false + }, + { + "type": "checkbox", + "attr": "pullDown", + "title": "Pull Down", + "hidden": "true || !['out', 'outlow','outhigh'].includes(data.configuration)", + "default": false + }, + { + "type": "text", + "attr": "label", + "title": "Label", + "placeholder": "GPIO Name" + } + ] + }, + "_GPIOError": { + "type": "staticText", + "text": "GPIOVauleERRORText", + "newLine": true, + "hidden": "if (!data.gpioSettings) return true; const values=[]; for(const r of data.gpioSettings) { if (!(r.gpio !== null && r.gpio !== '' && r.gpio >= 2 && r.gpio <= 27 && !values.includes(r.gpio))) {return false;} values.push(r.gpio); }; return true;", + "hideOnlyControl": true, + "style": { + "color": "red" + } + } + } + } + } +} diff --git a/admin/words.js b/admin/words.js index 2fe0ab4..77b1e25 100644 --- a/admin/words.js +++ b/admin/words.js @@ -8,35 +8,31 @@ 'use strict'; systemDictionary = { - "Button debounce period (ms)": { "en": "Button debounce period (ms)", "de": "Schaltflächen Entprellzeit (ms)", "ru": "Период устранения дребезга кнопки (мс)", "pt": "Período de debounce do botão (ms)", "nl": "Knop debounce-periode (ms)", "fr": "Période anti-rebond du bouton (ms)", "it": "Periodo antirimbalzo pulsante (ms)", "es": "Período de rebote del botón (ms)", "pl": "Okres odbijania przycisku (ms)", "uk": "", "zh-cn": "按钮反跳周期(毫秒)"}, - "Button double click period (ms)": { "en": "Button double click period (ms)", "de": "Doppelklickzeit (ms)", "ru": "Период двойного нажатия кнопки (мс)", "pt": "Período de duplo clique do botão (ms)", "nl": "Knop dubbelklikperiode (ms)", "fr": "Période de double clic sur le bouton (ms)", "it": "Periodo di doppio clic del pulsante (ms)", "es": "Período de doble clic del botón (ms)", "pl": "Okres podwójnego kliknięcia przycisku (ms)", "uk": "", "zh-cn": "按钮双击时间(毫秒)"}, - "Button long press period (ms)": { "en": "Button long press period (ms)", "de": "Taste lange Druckdauer (ms)", "ru": "Длительность нажатия кнопки (мс)", "pt": "Período de pressão longa do botão (ms)", "nl": "Knop lang indrukken (ms)", "fr": "Période de pression longue du bouton (ms)", "it": "Periodo di pressione prolungata del pulsante (ms)", "es": "Período de pulsación prolongada del botón (ms)", "pl": "Długie naciśnięcie przycisku (ms)", "uk": "", "zh-cn": "按钮长按周期(毫秒)"}, - "Buttons are wired pull up": { "en": "Buttons are wired pull up", "de": "Die Tasten sind hochgezogen", "ru": "Кнопки проводные подтягиваются вверх", "pt": "Os botões são puxados para cima", "nl": "Knopen zijn bedraad omhoog te trekken", "fr": "Les boutons sont tirés vers le haut", "it": "I pulsanti sono cablati pull up", "es": "Los botones están conectados con cable", "pl": "Przyciski są na drutach podciągane", "uk": "", "zh-cn": "按钮有线拉起"}, - "CPU": { "en": "CPU", "de": "CPU", "ru": "Процессор", "pt": "CPU", "nl": "CPU", "fr": "CPU", "it": "Processore", "es": "UPC", "pl": "procesor", "uk": "", "zh-cn": "CPU"}, - "Enable": { "en": "Enable", "de": "Aktivieren", "ru": "включить", "pt": "Habilitar", "nl": "Inschakelen", "fr": "Activer", "it": "Abilitare", "es": "Habilitar", "pl": "Włączyć", "uk": "", "zh-cn": "启用"}, - "Enabled": { "en": "Enabled", "de": "Aktiviert", "ru": "Активен", "pt": "ativado", "nl": "Ingeschakeld", "fr": "Activée", "it": "Abilitato", "es": "Habilitado", "pl": "Włączone", "uk": "", "zh-cn": "启用"}, - "GPIOs": { "en": "GPIOs", "de": "GPIOs", "ru": "GPIO Порты", "pt": "GPIOs", "nl": "GPIOs", "fr": "GPIO", "it": "GPIO", "es": "GPIOs", "pl": "GPIOs", "uk": "", "zh-cn": "Gpio"}, - "Input debounce period (ms)": { "en": "Input debounce period (ms)", "de": "Entprellungsperiode (ms) eingeben", "ru": "Входной период устранения дребезга (мс)", "pt": "Período de debounce de entrada (ms)", "nl": "Invoer debounce-periode (ms)", "fr": "Période anti-rebond d'entrée (ms)", "it": "Periodo antirimbalzo ingresso (ms)", "es": "Período de antirrebote de entrada (ms)", "pl": "Okres odbicia wejściowego (ms)", "uk": "", "zh-cn": "输入去抖动周期(毫秒)"}, - "Inputs are wired pull up": { "en": "Inputs are wired pull up", "de": "Die Eingänge sind hochgezogen", "ru": "Входы подключены подтягивающе", "pt": "As entradas são conectadas pull up", "nl": "Ingangen zijn bedraad pull-up", "fr": "Les entrées sont câblées vers le haut", "it": "Gli ingressi sono cablati pull up", "es": "Las entradas están cableadas", "pl": "Wejścia są przewodowe podciągane", "uk": "", "zh-cn": "输入有线上拉"}, - "Label": { "en": "Label", "de": "Etikett", "ru": "этикетка", "pt": "Rótulo", "nl": "Label", "fr": "Étiquette", "it": "Etichetta", "es": "Etiqueta", "pl": "Etykieta", "uk": "", "zh-cn": "标签"}, - "Memory": { "en": "Memory", "de": "Speicher", "ru": "Память", "pt": "Memória", "nl": "Geheugen", "fr": "Mémoire", "it": "Memoria", "es": "Memoria", "pl": "Pamięć", "uk": "", "zh-cn": "存储器"}, - "Minimum recommended is 2s. Set to zero to disable polling.": {"en": "Minimum recommended is 2s. Set to zero to disable polling.", "de": "Empfohlenes Minimum ist 2s. Auf Null setzen, um die Abfrage zu deaktivieren.", "ru": "Рекомендуемый минимум - 2 секунды. Установите в ноль, чтобы отключить опрос.", "pt": "O mínimo recomendado é 2s. Defina como zero para desativar a pesquisa.", "nl": "Minimaal aanbevolen is 2 sec. Stel in op nul om polling uit te schakelen.", "fr": "Le minimum recommandé est de 2 s. Réglez sur zéro pour désactiver l'interrogation.", "it": "Il minimo consigliato è di 2 secondi. Impostare a zero per disabilitare il polling.", "es": "El mínimo recomendado es 2 s. Establecer en cero para deshabilitar el sondeo.", "pl": "Zalecane minimum to 2 s. Ustaw na zero, aby wyłączyć odpytywanie.", "uk": "", "zh-cn": "推荐的最小值为2秒。设置为零可禁用轮询。"}, - "Network": { "en": "Network", "de": "Netzwerk", "ru": "Сеть", "pt": "Rede", "nl": "Netwerk", "fr": "Réseau", "it": "Rete locale", "es": "Red", "pl": "Sieć", "uk": "", "zh-cn": "网络"}, - "Poll": { "en": "Poll", "de": "Pollen", "ru": "Опрашивать", "pt": "Votação", "nl": "poll", "fr": "Sondage", "it": "Sondaggio", "es": "Encuesta", "pl": "Zapytanie", "uk": "", "zh-cn": "轮询"}, - "Polling interval for DHTxx/AM23xx devices (ms)": {"en": "Polling interval for DHTxx/AM23xx devices (ms)", "de": "Abfrageintervall für DHTxx / AM23xx-Geräte (ms)", "ru": "Интервал опроса для устройств DHTxx / AM23xx (мс)", "pt": "Intervalo de pesquisa para dispositivos DHTxx / AM23xx (ms)", "nl": "Polling-interval voor DHTxx / AM23xx-apparaten (ms)", "fr": "Intervalle d'interrogation pour les appareils DHTxx / AM23xx (ms)", "it": "Intervallo di polling per dispositivi DHTxx / AM23xx (ms)", "es": "Intervalo de sondeo para dispositivos DHTxx / AM23xx (ms)", "pl": "Okres odpytywania dla urządzeń DHTxx / AM23xx (ms)", "uk": "", "zh-cn": "DHTxx / AM23xx设备的轮询间隔(ms)"}, - "Port": { "en": "Port", "de": "Port", "ru": "Порт", "pt": "Porta", "nl": "Haven", "fr": "Port", "it": "Porta", "es": "Puerto", "pl": "Port", "uk": "", "zh-cn": "端口"}, - "Port numbers relate to Broadcom SOC channel, not physical pins.": {"en": "Port numbers relate to Broadcom SOC channel, not physical pins.", "de": "Die Portnummern beziehen sich auf den Broadcom SOC-Kanal, nicht auf physische Pins.", "ru": "Номера портов относятся к каналу Broadcom SOC, а не к физическим контактам.", "pt": "Os números das portas estão relacionados ao canal Broadcom SOC, não aos pinos físicos.", "nl": "Poortnummers hebben betrekking op het Broadcom SOC-kanaal, niet op fysieke pinnen.", "fr": "Les numéros de port concernent le canal SOC Broadcom, pas les broches physiques.", "it": "I numeri di porta si riferiscono al canale SOC Broadcom, non ai pin fisici.", "es": "Los números de puerto se refieren al canal Broadcom SOC, no a los pines físicos.", "pl": "Numery portów odnoszą się do kanału Broadcom SOC, a nie fizycznych pinów.", "uk": "", "zh-cn": "端口号与Broadcom SOC通道有关,与物理引脚无关。"}, - "RPI-Monitor Adapter settings": { "en": "RPI-Monitor Adapter settings", "de": "RPI-Monitor Adapter-Einstellungen", "ru": "Настройки RPI-монитор адаптера", "pt": "Configurações do adaptador RPI-Monitor", "nl": "RPI-Monitor Adapter-instellingen", "fr": "Paramètres de l'adaptateur RPI-Monitor", "it": "Impostazioni dell'adattatore RPI-Monitor", "es": "Configuración del adaptador RPI-Monitor", "pl": "Ustawienia adaptera RPI-Monitor", "uk": "", "zh-cn": "RPI-监视器的设置"}, - "Raspberry": { "en": "Raspberry", "de": "Raspberry", "ru": "Raspberry", "pt": "Framboesa", "nl": "Framboos", "fr": "Framboise", "it": "Raspberry", "es": "Frambuesa", "pl": "Malina", "uk": "", "zh-cn": "树莓"}, - "SDCard": { "en": "SD Card", "de": "SD Karte", "ru": "SD Карта", "pt": "Cartão SD", "nl": "SD-kaart", "fr": "Carte SD", "it": "Scheda SD", "es": "Tarjeta SD", "pl": "Karta SD", "uk": "", "zh-cn": "SD卡"}, - "Swap": { "en": "Swap", "de": "Swap", "ru": "Swap", "pt": "Troca", "nl": "ruil", "fr": "Échanger", "it": "Scambiare", "es": "Intercambiar", "pl": "Zamiana", "uk": "", "zh-cn": "交换"}, - "Temperature": { "en": "Temperature", "de": "Temperatur", "ru": "Температура", "pt": "Temperatura", "nl": "Temperatuur", "fr": "Température", "it": "Temperatura", "es": "Temperatura", "pl": "Temperatura", "uk": "", "zh-cn": "温度"}, - "Type": { "en": "Type", "de": "Typ", "ru": "Тип", "pt": "Tipo", "nl": "Type", "fr": "Type", "it": "Genere", "es": "Tipo", "pl": "Typ", "uk": "", "zh-cn": "类型"}, - "Uptime": { "en": "Uptime", "de": "Uptime", "ru": "Uptime", "pt": "Tempo de atividade", "nl": "Uptime", "fr": "Temps de disponibilité", "it": "Tempo di attività", "es": "Tiempo de actividad", "pl": "Czas pracy", "uk": "", "zh-cn": "正常运行时间"}, - "WLAN": { "en": "WLAN", "de": "WLAN", "ru": "WLAN", "pt": "WLAN", "nl": "WLAN", "fr": "WLAN", "it": "WLAN", "es": "WLAN", "pl": "WLAN", "uk": "", "zh-cn": "WLAN"}, - "button": { "en": "Button with click, double-click, long press, etc.", "de": "Taste mit Klick, Doppelklick, langem Drücken usw.", "ru": "Кнопка с щелчком, двойным щелчком, долгим нажатием и т. Д.", "pt": "Botão com clique, clique duplo, toque longo, etc.", "nl": "Knop met klikken, dubbelklikken, lang indrukken, etc.", "fr": "Bouton avec clic, double-clic, appui long, etc.", "it": "Pulsante con clic, doppio clic, pressione prolungata, ecc.", "es": "Botón con clic, doble clic, pulsación larga, etc.", "pl": "Przycisk z kliknięciem, podwójnym kliknięciem, długim naciśnięciem itp.", "uk": "", "zh-cn": "单击,双击,长按等按钮"}, - "in": { "en": "Input", "de": "Eingang", "ru": "Вход", "pt": "Entrada", "nl": "Ingang", "fr": "Entrée", "it": "Ingresso", "es": "Entrada", "pl": "Wejście", "uk": "", "zh-cn": "在"}, - "out": { "en": "Output", "de": "Ausgang", "ru": "Выход", "pt": "Saída", "nl": "Uitgang", "fr": "Sortie", "it": "Uscita", "es": "Salida", "pl": "Wyjście", "uk": "", "zh-cn": "出来"}, - "outhigh": { "en": "Output, initial value 1", "de": "Ausgang, Startwert 1", "ru": "Выход, начальное значение 1", "pt": "Saída, valor inicial 1", "nl": "Uitgang, beginwaarde 1", "fr": "Sortie, valeur initiale 1", "it": "Uscita, valore iniziale 1", "es": "Salida, valor inicial 1", "pl": "Wyjście, wartość początkowa 1", "uk": "", "zh-cn": "输出,初始值1"}, - "outlow": { "en": "Output, initial value 0", "de": "Ausgang, Startwert 0", "ru": "Выход, начальное значение 0", "pt": "Saída, valor inicial 0", "nl": "Uitgang, beginwaarde 0", "fr": "Sortie, valeur initiale 0", "it": "Uscita, valore iniziale 0", "es": "Salida, valor inicial 0", "pl": "Wyjście, wartość początkowa 0", "uk": "", "zh-cn": "输出,初始值0"}, + "CPU": { "en": "CPU", "de": "CPU", "ru": "CPU", "pt": "CPU", "nl": "CPU", "fr": "CPU", "it": "CPU", "es": "CPU", "pl": "CPU", "uk": "CPU", "zh-cn": "CPU"}, + "Raspberry": { "en": "Raspberry", "de": "Raspberry", "ru": "Raspberry", "pt": "Raspberry", "nl": "Raspberry", "fr": "Raspberry", "it": "Raspberry", "es": "Raspberry", "pl": "Raspberry", "uk": "Raspberry", "zh-cn": "Raspberry"}, + "Memory": { "en": "Memory", "de": "Memory", "ru": "Memory", "pt": "Memory", "nl": "Memory", "fr": "Memory", "it": "Memory", "es": "Memory", "pl": "Memory", "uk": "Memory", "zh-cn": "Memory"}, + "Network": { "en": "Network", "de": "Network", "ru": "Network", "pt": "Network", "nl": "Network", "fr": "Network", "it": "Network", "es": "Network", "pl": "Network", "uk": "Network", "zh-cn": "Network"}, + "SDCard": { "en": "SD Card", "de": "SD Card", "ru": "SD Card", "pt": "SD Card", "nl": "SD Card", "fr": "SD Card", "it": "SD Card", "es": "SD Card", "pl": "SD Card", "uk": "SD Card", "zh-cn": "SD Card"}, + "Swap": { "en": "Swap", "de": "Swap", "ru": "Swap", "pt": "Swap", "nl": "Swap", "fr": "Swap", "it": "Swap", "es": "Swap", "pl": "Swap", "uk": "Swap", "zh-cn": "Swap"}, + "Temperature": { "en": "Temperature", "de": "Temperature", "ru": "Temperature", "pt": "Temperature", "nl": "Temperature", "fr": "Temperature", "it": "Temperature", "es": "Temperature", "pl": "Temperature", "uk": "Temperature", "zh-cn": "Temperature"}, + "Uptime": { "en": "Uptime", "de": "Uptime", "ru": "Uptime", "pt": "Uptime", "nl": "Uptime", "fr": "Uptime", "it": "Uptime", "es": "Uptime", "pl": "Uptime", "uk": "Uptime", "zh-cn": "Uptime"}, + "WLAN": { "en": "WLAN", "de": "WLAN", "ru": "WLAN", "pt": "WLAN", "nl": "WLAN", "fr": "WLAN", "it": "WLAN", "es": "WLAN", "pl": "WLAN", "uk": "WLAN", "zh-cn": "WLAN"}, + "MonitoringExplanation": { "en": "Select which elements to monitor. They will be polled on a regular basis and states will be created as needed.", "de": "Wählen Sie aus, welche Elemente überwacht werden sollen. Sie werden regelmäßig befragt und bei Bedarf werden Zustände erstellt.", "ru": "Выберите, какие элементы отслеживать. Они будут регулярно опрашиваться и по мере необходимости создаваться штаты.", "pt": "Selecione quais elementos monitorar. Eles serão pesquisados ​​regularmente e estados serão criados conforme necessário.", "nl": "Selecteer welke elementen u wilt monitoren. Zij zullen op regelmatige basis worden ondervraagd en indien nodig zullen er staten worden opgericht.", "fr": "Sélectionnez les éléments à surveiller. Ils seront interrogés régulièrement et des États seront créés selon les besoins.", "it": "Seleziona quali elementi monitorare. Saranno sottoposti a votazioni su base regolare e gli stati verranno creati secondo necessità.", "es": "Seleccione qué elementos monitorear. Serán encuestados periódicamente y se crearán estados según sea necesario.", "pl": "Wybierz elementy do monitorowania. Będą one regularnie ankietowane, a stany będą tworzone w miarę potrzeb.", "uk": "Виберіть елементи для моніторингу. Їх опитуватимуть на регулярній основі, а за потреби створюватимуть штати.", "zh-cn": "选择要监视的元素。他们将定期接受民意调查,并根据需要创建州。"}, + "Monitoring": { "en": "Monitoring", "de": "Überwachung", "ru": "Мониторинг", "pt": "Monitoramento", "nl": "Toezicht", "fr": "Surveillance", "it": "Monitoraggio", "es": "Escucha", "pl": "Monitorowanie", "uk": "Моніторинг", "zh-cn": "监控"}, + "GPIOs": { "en": "GPIOs", "de": "GPIOs", "ru": "GPIO", "pt": "GPIOs", "nl": "GPIO's", "fr": "GPIO", "it": "GPIO", "es": "GPIO", "pl": "GPIO", "uk": "GPIO", "zh-cn": "GPIO"}, + "GPIOConfigExplanation": { "en": "Add GPIO configurations here. Press on +, select if input or output and so on. Port numbers relate to Broadcom SOC channel, not physical pins. For inputs enter a debounce time in milliseconds into the Debounce / Poll column. For DHT11/22 Temperature sensors, the value in that column will be the poll interval.", "de": "Fügen Sie hier GPIO-Konfigurationen hinzu. Drücken Sie auf +, wählen Sie Eingabe oder Ausgabe aus und so weiter. Portnummern beziehen sich auf den Broadcom SOC-Kanal, nicht auf physische Pins. Geben Sie für Eingaben eine Entprellzeit in Millisekunden in die Spalte „Entprellung/Abfrage“ ein. Bei DHT11/22-Temperatursensoren ist der Wert in dieser Spalte das Abfrageintervall.", "ru": "Добавьте сюда конфигурации GPIO. Нажмите +, выберите вход или выход и так далее. Номера портов относятся к каналу Broadcom SOC, а не к физическим контактам. В качестве входных данных введите время устранения дребезга в миллисекундах в столбце «Устранение дребезга/опрос». Для датчиков температуры DHT11/22 значением в этом столбце будет интервал опроса.", "pt": "Adicione configurações GPIO aqui. Pressione +, selecione se é entrada ou saída e assim por diante. Os números das portas estão relacionados ao canal SOC da Broadcom, não aos pinos físicos. Para entradas, insira um tempo de rejeição em milissegundos na coluna Debounce/Poll. Para sensores de temperatura DHT11/22, o valor nessa coluna será o intervalo de pesquisa.", "nl": "Voeg hier GPIO-configuraties toe. Druk op +, selecteer of invoer of uitvoer enzovoort. Poortnummers hebben betrekking op het Broadcom SOC-kanaal, niet op fysieke pinnen. Voer voor invoer een debouncetijd in milliseconden in de kolom Debounce / Poll in. Voor DHT11/22-temperatuursensoren is de waarde in die kolom het poll-interval.", "fr": "Ajoutez des configurations GPIO ici. Appuyez sur +, sélectionnez si entrée ou sortie et ainsi de suite. Les numéros de port concernent le canal Broadcom SOC et non les broches physiques. Pour les entrées, entrez un temps anti-rebond en millisecondes dans la colonne Anti-rebond / Sondage. Pour les capteurs de température DHT11/22, la valeur dans cette colonne sera l'intervalle d'interrogation.", "it": "Aggiungi le configurazioni GPIO qui. Premere su +, selezionare se ingresso o uscita e così via. I numeri di porta si riferiscono al canale SOC Broadcom, non ai pin fisici. Per gli input inserire un tempo di antirimbalzo in millisecondi nella colonna Antirimbalzo/Poll. Per i sensori di temperatura DHT11/22, il valore in quella colonna sarà l'intervallo di poll.", "es": "Agregue configuraciones GPIO aquí. Presione +, seleccione si es entrada o salida, etc. Los números de puerto se relacionan con el canal SOC de Broadcom, no con los pines físicos. Para las entradas, ingrese un tiempo de rebote en milisegundos en la columna Antirrebote/Encuesta. Para los sensores de temperatura DHT11/22, el valor en esa columna será el intervalo de sondeo.", "pl": "Dodaj tutaj konfiguracje GPIO. Naciśnij +, wybierz wejście lub wyjście i tak dalej. Numery portów odnoszą się do kanału Broadcom SOC, a nie do fizycznych pinów. W przypadku wejść wprowadź czas odbicia w milisekundach w kolumnie Odbicie/odpytywanie. Dla czujników temperatury DHT11/22 wartość w tej kolumnie będzie interwałem odpytywania.", "uk": "Додайте сюди конфігурації GPIO. Натисніть +, виберіть вхід чи вихід і так далі. Номери портів стосуються каналу Broadcom SOC, а не фізичних контактів. Для вхідних даних введіть час усунення дребезгу в мілісекундах у стовпці Усунення дребезгу/опитування. Для датчиків температури DHT11/22 значення в цьому стовпці буде інтервалом опитування.", "zh-cn": "此处添加 GPIO 配置。按+,选择输入或输出等。端口号与 Broadcom SOC 通道相关,与物理引脚无关。对于输入,请在“去抖/轮询”列中输入以毫秒为单位的去抖时间。对于 DHT11/22 温度传感器,该列中的值将是轮询间隔。"}, + "pullupwarning": { "en": "WARNING: Pull up / Pull down is not really supported, currently. It should be in future, but it never was in the past. Be sure not to break anything.", "de": "ACHTUNG: Pull-Up/Pull-Down wird derzeit nicht wirklich unterstützt. Es sollte in der Zukunft sein, aber es war nie in der Vergangenheit. Achten Sie darauf, dass nichts kaputt geht.", "ru": "ВНИМАНИЕ: Pull up/Pull down в настоящее время не поддерживается. Это должно быть в будущем, но этого никогда не было в прошлом. Будьте уверены, чтобы ничего не сломать.", "pt": "AVISO: Pull up / Pull down não é realmente suportado atualmente. Deveria estar no futuro, mas nunca esteve no passado. Certifique-se de não quebrar nada.", "nl": "WAARSCHUWING: Pull up / Pull down wordt momenteel niet echt ondersteund. Het zou in de toekomst moeten gebeuren, maar dat is in het verleden nooit zo geweest. Zorg ervoor dat je niets kapot maakt.", "fr": "AVERTISSEMENT : Pull up / Pull down n'est pas vraiment pris en charge actuellement. Cela devrait être le cas dans le futur, mais cela ne l’a jamais été dans le passé. Assurez-vous de ne rien casser.", "it": "ATTENZIONE: Pull up/Pull down non è attualmente supportato. Dovrebbe essere nel futuro, ma non lo è mai stato nel passato. Assicurati di non rompere nulla.", "es": "ADVERTENCIA: Pull up / Pull down no es realmente compatible actualmente. Debería serlo en el futuro, pero nunca lo fue en el pasado. Asegúrate de no romper nada.", "pl": "OSTRZEŻENIE: Funkcja podciągania i opuszczania nie jest obecnie obsługiwana. Powinno to nastąpić w przyszłości, ale nigdy tak nie było w przeszłości. Pamiętaj, aby niczego nie złamać.", "uk": "ПОПЕРЕДЖЕННЯ: наразі функція Pull up / Pull down не підтримується. Це має бути в майбутньому, але цього ніколи не було в минулому. Стежте, щоб нічого не зламати.", "zh-cn": "警告:目前并不真正支持上拉/下拉。它应该是在未来,但它从来不是在过去。确保不要破坏任何东西。"}, + "GPIO Number": { "en": "GPIO Number", "de": "GPIO-Nummer", "ru": "Номер GPIO", "pt": "Número GPIO", "nl": "GPIO-nummer", "fr": "Numéro GPIO", "it": "Numero GPIO", "es": "Número GPIO", "pl": "Numer GPIO", "uk": "Номер GPIO", "zh-cn": "GPIO 数量"}, + "Type": { "en": "Type", "de": "Typ", "ru": "Тип", "pt": "Tipo", "nl": "Type", "fr": "Taper", "it": "Tipo", "es": "Tipo", "pl": "Typ", "uk": "Тип", "zh-cn": "类型"}, + "in": { "en": "Input", "de": "Eingang", "ru": "Вход", "pt": "Entrada", "nl": "Invoer", "fr": "Saisir", "it": "Ingresso", "es": "Aporte", "pl": "Wejście", "uk": "Введення", "zh-cn": "输入"}, + "out": { "en": "Output", "de": "Ausgabe", "ru": "Выход", "pt": "Saída", "nl": "Uitvoer", "fr": "Sortir", "it": "Produzione", "es": "Producción", "pl": "Wyjście", "uk": "Вихід", "zh-cn": "输出"}, + "outhigh": { "en": "Output, initial value 1", "de": "Ausgabe, Anfangswert 1", "ru": "Выход, начальное значение 1", "pt": "Saída, valor inicial 1", "nl": "Uitgang, beginwaarde 1", "fr": "Sortie, valeur initiale 1", "it": "Uscita, valore iniziale 1", "es": "Salida, valor inicial 1", "pl": "Wyjście, wartość początkowa 1", "uk": "Вихід, початкове значення 1", "zh-cn": "输出,初始值1"}, + "outlow": { "en": "Output, initial value 0", "de": "Ausgabe, Anfangswert 0", "ru": "Выход, начальное значение 0", "pt": "Saída, valor inicial 0", "nl": "Uitgang, beginwaarde 0", "fr": "Sortie, valeur initiale 0", "it": "Uscita, valore iniziale 0", "es": "Salida, valor inicial 0", "pl": "Wyjście, wartość początkowa 0", "uk": "Вихід, початкове значення 0", "zh-cn": "输出,初始值0"}, + "DHT11": { "en": "DHT11 Temperatur and Humidity Sensor", "de": "DHT11 Temperatur- und Feuchtigkeitssensor", "ru": "DHT11 Датчик температуры и влажности", "pt": "Sensor de temperatura e umidade DHT11", "nl": "DHT11 temperatuur- en vochtigheidssensor", "fr": "Capteur de température et d'humidité DHT11", "it": "Sensore di temperatura e umidità DHT11", "es": "Sensor de temperatura y humedad DHT11", "pl": "Czujnik temperatury i wilgotności DHT11", "uk": "Датчик температури та вологості DHT11", "zh-cn": "DHT11温湿度传感器"}, + "DHT22": { "en": "DHT22/AM23xx Temperatur and Humidity Sensor", "de": "DHT22/AM23xx Temperatur- und Feuchtigkeitssensor", "ru": "DHT22/AM23xx Датчик температуры и влажности", "pt": "Sensor de temperatura e umidade DHT22/AM23xx", "nl": "DHT22/AM23xx temperatuur- en vochtigheidssensor", "fr": "Capteur de température et d'humidité DHT22/AM23xx", "it": "Sensore di temperatura e umidità DHT22/AM23xx", "es": "Sensor de temperatura y humedad DHT22/AM23xx", "pl": "Czujnik temperatury i wilgotności DHT22/AM23xx", "uk": "DHT22/AM23xx Датчик температури та вологості", "zh-cn": "DHT22/AM23xx温湿度传感器"}, + "Debounce / Poll (ms)": { "en": "Debounce / Poll (ms)", "de": "Entprellung / Abfrage (ms)", "ru": "Отказ/опрос (мс)", "pt": "Debounce/Enquete (ms)", "nl": "Debounce/peiling (ms)", "fr": "Anti-rebond / Sondage (ms)", "it": "Rimbalzo/Poll (ms)", "es": "Antirrebote / Encuesta (ms)", "pl": "Odrzucenie/ankieta (ms)", "uk": "Відбій/опитування (мс)", "zh-cn": "去抖/轮询(毫秒)"}, + "Pull Up": { "en": "Pull Up", "de": "Hochziehen", "ru": "Остановить", "pt": "Puxe para cima", "nl": "Trek omhoog", "fr": "Tirer vers le haut", "it": "Tirati su", "es": "Levantar", "pl": "Zatrzymać się", "uk": "Підтягнутись", "zh-cn": "拉起"}, + "Pull Down": { "en": "Pull Down", "de": "Nach unten ziehen", "ru": "Потянуть вниз", "pt": "Puxar para baixo", "nl": "Trek naar beneden", "fr": "Abattre", "it": "Tirare giù", "es": "Derribar", "pl": "Rozbierać", "uk": "Потягніть вниз", "zh-cn": "下拉"}, + "Label": { "en": "Label", "de": "Beschriftung", "ru": "Этикетка", "pt": "Rótulo", "nl": "Label", "fr": "Étiquette", "it": "Etichetta", "es": "Etiqueta", "pl": "Etykieta", "uk": "Мітка", "zh-cn": "标签"}, + "GPIOVauleERRORText": { "en": "Error: GPIO Number must not be empty, must be unique and between 2 and 27.", "de": "Fehler: GPIO Nummer darf nicht leer sein, muss eindeutig sein und zwischen 2 und 27 liegen.", "ru": "Ошибка: номер GPIO не должен быть пустым, должен быть уникальным и находиться в диапазоне от 2 до 27.", "pt": "Erro: o número GPIO não deve estar vazio, deve ser único e estar entre 2 e 27.", "nl": "Fout: GPIO-nummer mag niet leeg zijn, moet uniek zijn en tussen 2 en 27 liggen.", "fr": "Erreur : Le numéro GPIO ne doit pas être vide, doit être unique et compris entre 2 et 27.", "it": "Errore: il numero GPIO non deve essere vuoto, deve essere univoco e compreso tra 2 e 27.", "es": "Error: el número GPIO no debe estar vacío, debe ser único y estar entre 2 y 27.", "pl": "Błąd: Numer GPIO nie może być pusty, musi być unikalny i zawierać się w przedziale od 2 do 27.", "uk": "Помилка: номер GPIO не має бути порожнім, має бути унікальним і мати значення від 2 до 27.", "zh-cn": "错误:GPIO 编号不能为空,必须唯一且介于 2 到 27 之间。"}, }; \ No newline at end of file diff --git a/io-package.json b/io-package.json index c0a55d6..dd3f55f 100755 --- a/io-package.json +++ b/io-package.json @@ -78,7 +78,8 @@ "it": "Richiede js-controller 3.3 o successivo! Allo js.controller per eseguire una ricostruzione quando GPIO è configurato ma non riesce", "es": "¡Requiere js-controller 3.3 o superior! Allo js.controller para hacer una reconstrucción cuando GPIO está configurado pero falla", "pl": "Wymaga kontrolera js w wersji 3.3 lub nowszej! Allo js.controller do przebudowy, gdy GPIO jest skonfigurowane, ale się nie powiedzie", - "zh-cn": "需要 js-controller 3.3 或更高版本! Allo js.controller 在配置 GPIO 但失败时进行重建" + "zh-cn": "需要 js-controller 3.3 或更高版本! Allo js.controller 在配置 GPIO 但失败时进行重建", + "uk": "Потрібен js-контролер 3.3 або вище! Allo js.controller для виконання перебудови, коли GPIO налаштовано, але не вдається" }, "1.3.1": { "en": "js-controller 3.3 warnings prevented", @@ -90,7 +91,8 @@ "it": "js-controller 3.3 avvisi impediti", "es": "advertencias de js-controller 3.3 prevenidas", "pl": "js-controller 3.3 zablokowano ostrzeżenia", - "zh-cn": "js-controller 3.3 警告被阻止" + "zh-cn": "js-controller 3.3 警告被阻止", + "uk": "попередження js-controller 3.3 запобігли" } }, "titleLang": { @@ -194,7 +196,7 @@ "zh-cn": "科普罗 中断更改" }, "text": { - "en": "GPIO needed massive changes for support of newer Raspian versions (Bookworm and following). Please check your GPIO configuration and if everything still works. GPIO Button support is removed. If you need it, please discuss in Github, see link.", + "en": "GPIO needed massive changes for support of newer Raspian versions (Bookworm and following). Please check your GPIO configuration and if everything still works. GPIO Button support is removed. If you need it, please discuss in Github, see link. - Also, keep in mind that hardware pull up / down is still not supported.", "de": "GPIO brauchte massive Änderungen für die Unterstützung neuerer Raspian Versionen (Bookworm und nachfolgend). Bitte überprüfen Sie Ihre GPIO-Konfiguration und wenn alles noch funktioniert. GPIO Button-Unterstützung wird entfernt. Wenn Sie es brauchen, diskutieren Sie bitte in Github, siehe Link.", "ru": "GPIO нуждались в массовых изменениях для поддержки более новых версий Raspian (Bookworm и следующий). Пожалуйста, проверьте конфигурацию GPIO и все ли еще работает. Поддержка GPIO Button удалена. Если вам это нужно, пожалуйста, обсудите в Гитубе, см. ссылку.", "pt": "O GPIO precisava de mudanças massivas para o suporte de versões mais recentes do Raspian (Bookworm e seguintes). Por favor, verifique sua configuração GPIO e se tudo ainda funciona. O suporte do botão GPIO é removido. Se precisar, por favor, discuta no Github, veja link.", @@ -239,14 +241,7 @@ "c_uptime": true, "c_wlan": true, "interval": 60000, - "gpios": [], - "forceinit": false, - "inputPullUp": false, - "buttonPullUp": false, - "inputDebounceMs": 0, - "buttonPressMs": 200, - "buttonDoubleMs": 500, - "dhtPollInterval": 15000 + "gpioSettings": [] }, "objects": [], "instanceObjects": [] diff --git a/lib/configConverter.js b/lib/configConverter.js new file mode 100644 index 0000000..eb02e1c --- /dev/null +++ b/lib/configConverter.js @@ -0,0 +1,91 @@ +const obsoleteFields = [ + //buttons deprecated for now, but lets keep their settings a while until a final decision is made. + //'buttonPressMs', //deprecated for now + //'buttonDoubleMs', //deprecated for now + 'buttonPullUp', //deprecated for now + 'buttonDebounceMs', //deprecated for now + + 'inputPullUp', //now a per gpio setting + 'inputDebounceMs', //now a per gpio setting + 'dhtPollInterval', //now a per gpio setting + 'inputPollIntervalMs', //seems to be already deprecated + //old parser stuff: + 'cpu', 'raspberry', 'memory', 'network', 'sdcard', 'swap', 'temperature', 'uptime', 'wlan' +]; + +exports.convertConfig = function (currentConfig, adapter) { + let changed = false; + const logging = ['Updating config from \n', JSON.stringify(currentConfig, null, 2), '\nto\n']; + const defaultDebounceInterval = currentConfig.inputDebounceMs; + const defaultInputPullUp = currentConfig.inputPullUp; + const dhtPollInterval = currentConfig.dhtPollInterval; + //first, let's get rid of old in config parser stuff: + for (const obsoleteField of obsoleteFields) { + if (currentConfig[obsoleteField] !== undefined) { + delete currentConfig[obsoleteField]; + changed = true; + } + } + + if (!currentConfig.gpioSettings) { + currentConfig.gpioSettings = []; + } + if (currentConfig.gpios) { + changed = true; + for (let i = 0; i < currentConfig.gpios.length; i++) { + const gpio = currentConfig.gpios[i]; + if (gpio !== null && gpio.enabled) { + //handle old boolean input settings + if (typeof gpio.input === 'boolean') { + gpio.input = gpio.input ? 'in' : 'out'; + } + if (gpio.input === 'true') { + gpio.input = 'in'; + } + if (gpio.input === 'false') { + gpio.input = 'out'; + } + + const newGpio = { + gpio: i, + label: gpio.label, + configuration: gpio.input + }; + switch (gpio.input) { + case 'button': { + newGpio.debounceOrPoll = currentConfig.buttonDebounceMs; + newGpio.pullUp = currentConfig.buttonPullUp; + break; + } + case 'in': { + newGpio.debounceOrPoll = defaultDebounceInterval; + newGpio.pullUp = defaultInputPullUp; + break; + } + case 'dht11': + case 'dht22': { + newGpio.debounceOrPoll = dhtPollInterval; + break; + } + } + + const alreadyConfiguredGPIO = currentConfig.gpioSettings.find(g => g.gpio === i); + if (alreadyConfiguredGPIO) { + adapter.log.warn(`GPIO ${i} already configured. Skipping old settings ${JSON.stringify(gpio)}.`); + } else { + currentConfig.gpioSettings.push(newGpio); + } + } + } + } + delete currentConfig.gpios; + + if (changed) { + logging.push(JSON.stringify(currentConfig, null, 2)); + logging.push('\n'); + adapter.log.debug(logging.join('')); + } + + return changed; +}; + diff --git a/lib/gpioControl.js b/lib/gpioControl.js index 943e717..362faab 100644 --- a/lib/gpioControl.js +++ b/lib/gpioControl.js @@ -24,9 +24,9 @@ class GpioControl { this.adapter = adapter; this.gpioChip = null; //this.gpioButtons = null; - this.config = adapter.config; this.log = log; this.gpioPorts = []; + this.gpioSettings = []; this.gpioPortLastWrite = []; this.gpioInputPorts = []; this.gpioOutputPorts = []; @@ -35,8 +35,8 @@ class GpioControl { /** * Setup GPIO ports & buttons - * @param gpioPorts {number[]} - * @param buttonPorts {number[]} + * @param gpioPorts {Array} + * @param buttonPorts {Array} * @returns undefined */ async setupGpio(gpioPorts, buttonPorts) { @@ -64,13 +64,6 @@ class GpioControl { this.log.error('Cannot read CPU Info: ' + e); } - //this.log.debug(Input); - //this.log.debug(Output); - - this.log.debug('Inputs are pull ' + (this.config.inputPullUp ? 'up' : 'down') + '.'); - this.log.debug('Buttons are pull ' + (this.config.buttonPullUp ? 'up' : 'down') + '.'); - - //this.gpioChip = openGpioChip(chipPath); -> somehow not necessary with this library? this.gpioChip = DefaultDevice; if (this.gpioChip === undefined) { this.log.warn('Cannot initialize GPIO: No chip found. GPIO functionality disabled!'); @@ -82,28 +75,32 @@ class GpioControl { if (this.gpioChip) { // Setup all the regular GPIO input and outputs. - for (const port of gpioPorts) { - const direction = this.config.gpios[port].input; - this.log.debug(`Port ${port} direction: ${direction}`); + for (const gpioSetting of gpioPorts) { + const direction = gpioSetting.configuration; + this.log.debug(`Port ${gpioSetting.gpio} direction: ${direction}`); //TODO: currently pull-up / pull-down is not supported by the library. + //sanitize timeouts: + gpioSetting.debounceOrPoll = Math.min(Number(gpioSetting.debounceOrPoll) || 0, 10000); + this.gpioSettings[gpioSetting.gpio] = gpioSetting; //keep settings for later. if (direction === 'in') { - const watch = this.gpioChip.watch({chip: chipNum, line: port}, Edge.Both); - this.gpioPorts[port] = watch; - this.gpioInputPorts.push(port); - await this.readValue(port); + const watch = this.gpioChip.watch({chip: chipNum, line: gpioSetting.gpio}, Edge.Both); + this.gpioPorts[gpioSetting.gpio] = watch; + this.gpioInputPorts.push(gpioSetting.gpio); + await this.readValue(gpioSetting.gpio); } else { - const pin = this.gpioChip.output({chip: chipNum, line: port}); - this.gpioPorts[port] = pin; - this.gpioOutputPorts.push(port); + const pin = this.gpioChip.output({chip: chipNum, line: gpioSetting.gpio}); + this.gpioPorts[gpioSetting.gpio] = pin; + this.gpioOutputPorts.push(gpioSetting.gpio); } } - for (const port of buttonPorts) { + for (const gpioSetting of buttonPorts) { //still the same as input ports... - const watch = this.gpioChip.watch({chip: chipNum, line: port}, Edge.Both); - this.gpioPorts[port] = watch; - this.gpioInputPorts.push(port); - await this.readValue(port); + this.gpioSettings[gpioSetting.gpio] = gpioSetting; //keep settings for later. + const watch = this.gpioChip.watch({chip: chipNum, line: gpioSetting.gpio}, Edge.Both); + this.gpioPorts[gpioSetting.gpio] = watch; + this.gpioInputPorts.push(gpioSetting.gpio); + await this.readValue(gpioSetting.gpio); } for (const port of this.gpioInputPorts) { @@ -114,8 +111,8 @@ class GpioControl { if (this.gpioPortLastWrite[port] === undefined) { this.gpioPortLastWrite[port] = 0; } - if (Date.now() - this.gpioPortLastWrite[port] < this.config.inputDebounceMs) { - this.log.debug(`Ignoring change event due to debounce: ${(Date.now() - this.gpioPortLastWrite[port])}ms < ${this.config.inputDebounceMs}.`); + if (Date.now() - this.gpioPortLastWrite[port] < this.gpioSettings[port].debounceOrPoll) { + this.log.debug(`Ignoring change event due to debounce: ${(Date.now() - this.gpioPortLastWrite[port])}ms < ${this.gpioSettings[port].debounceOrPoll}.`); return; } await this.readValue(port, value); @@ -192,9 +189,10 @@ class GpioControl { if (typeof value === 'undefined') { value = this.gpioPorts[port].value; } - this.log.debug(`Setting state for port ${port} to ${value}`); this.gpioPortLastWrite[port] = Date.now(); - await this.adapter.setState('gpio.' + port + '.state', this.inputPullUp(value), true); + value = this.gpioSettings[port].pullUp ? !value : value; + this.log.debug(`Setting state for port ${port} to ${value}`); + await this.adapter.setState('gpio.' + port + '.state', value, true); } catch (err) { this.log.error('Cannot read port ' + port + ': ' + err); } @@ -212,11 +210,12 @@ class GpioControl { } port = parseInt(port, 10); - if (!this.config.gpios[port] || !this.config.gpios[port].enabled) { + if (!this.gpioSettings[port]) { this.log.warn('Port ' + port + ' is not writable, because disabled.'); return; - } else if (this.config.gpios[port].input === 'in' || this.config.gpios[port].input === 'true' || this.config.gpios[port].input === true) { - return this.log.warn('Port ' + port + ' is configured as input and not writable'); + } else if (!this.gpioSettings[port].configuration.startsWith('out')) { + this.log.warn('Port ' + port + ' is configured as input and not writable'); + return; } if (value === 'true') value = true; @@ -228,8 +227,8 @@ class GpioControl { if (this.gpioPorts[port]) { try { let invert = false; - if (this.config.gpios[port].input === 'outhigh') { - this.log.debug(`Inverting value from ${value} to ${!value} for port ${port} because set to ${this.config.gpios[port].input}`); + if (this.gpioSettings[port].configuration === 'outhigh') { + this.log.debug(`Inverting value from ${value} to ${!value} for port ${port} because set to ${this.gpioSettings[port].configuration}`); invert = true; } @@ -247,15 +246,6 @@ class GpioControl { } } - /** - * Converts value depending on inputPullUp setting. - * @param value {number|boolean} - * @returns {boolean} - */ - inputPullUp(value) { - return !!(this.config.inputPullUp ? !value : value); - } - /** * Cleanup on unload. * @returns {Promise} diff --git a/main.js b/main.js index f3942e6..8776da9 100755 --- a/main.js +++ b/main.js @@ -12,8 +12,9 @@ // The adapter-core module gives you access to the core ioBroker functions // you need to create an adapter const utils = require('@iobroker/adapter-core'); -const parsers = require('./lib/parsers'); +const parsers = require('./lib/parsers.json'); const {buttonEvents, GpioControl} = require('./lib/gpioControl'); +const {convertConfig} = require('./lib/configConverter'); const errorsLogged = {}; const intervalTimers = []; @@ -37,32 +38,23 @@ class Rpi2 extends utils.Adapter { async onReady() { objects = {}; - - //sanitize timeouts: - this.config.inputDebounceMs = Math.min(Number(this.config.inputDebounceMs) || 0, 10000); + if (convertConfig(this.config, this)) { + this.log.info('Config updated, will write new config and restart adapter.'); + const id = 'system.adapter.' + this.namespace; + this.log.error('would write: ' + id + '\nconfig' + JSON.stringify(this.config, null, 2)); + const instanceObject = await this.getForeignObjectAsync(id); + if (instanceObject) { + console.log('instanceObject: ' + JSON.stringify(instanceObject)); + instanceObject.native = this.config; + await this.setForeignObject(id, instanceObject); + } + } const adapterObjects = await this.getAdapterObjectsAsync(); - if (this.config.forceinit) { - for (const id of Object.keys(adapterObjects)) { - if (/^rpi2\.\d+$/.test(id)) { - this.log.debug('Skip root object ' + id); - continue; - } - - this.log.debug('Remove ' + id + ': ' + id); - try { - await this.delObjectAsync(id); - await this.deleteStateAsync(id); - } catch (err) { - this.log.error('Could not delete ' + id + ': ' + err); - } - } - } else { - for (const id of Object.keys(adapterObjects)) { - objects[id] = true; //object already exists. - } - this.log.debug('received all objects'); + for (const id of Object.keys(adapterObjects)) { + objects[id] = true; //object already exists. } + this.log.debug('received all objects'); this.gpioControl = new GpioControl(this, this.log); await this.subscribeStatesAsync('*'); await main(this); @@ -70,50 +62,53 @@ class Rpi2 extends utils.Adapter { } async initPorts() { - if (this.config.gpios && this.config.gpios.length) { + if (this.config.gpioSettings && this.config.gpioSettings.length) { const gpioPorts = []; const buttonPorts = []; const dhtPorts = []; - for (let port = 0; port < this.config.gpios.length; port++) { - if (this.config.gpios[port]) { - /* Ensure backwards compatibility of property .input - * in older versions, it was true for "in" and false for "out" - * in newer versions, it is "in", "out", "outlow" or "outhigh" - * Do this now, so we only have to check for newer versions everywhere else. - */ - if (this.config.gpios[port].input === 'true' || this.config.gpios[port].input === true) { - this.config.gpios[port].input = 'in'; - } - else if (this.config.gpios[port].input === 'false' || this.config.gpios[port].input === false) { - this.config.gpios[port].input = 'out'; - } - } - + for (const gpioSetting of this.config.gpioSettings) { // syncPort sets up the object tree. // Do it now so all ready when // physical GPIOs are enabled below. - await this.syncPort(port, this.config.gpios[port] || {}); - - if (this.config.gpios[port] && this.config.gpios[port].enabled) { - - // Push port numbers into arrays as required for the setup below. - switch (this.config.gpios[port].input) { - case 'in': - case 'out': - case 'outlow': - case 'outhigh': - gpioPorts.push(port); - break; - case 'button': - buttonPorts.push(port); - break; - case 'dht11': - case 'dht22': - dhtPorts.push(port); - break; - default: - this.log.error('Cannot setup port ' + port + ': invalid direction type.'); + await this.syncPort(gpioSetting); + + // Push port numbers into arrays as required for the setup below. + switch (gpioSetting.configuration) { + case 'in': + case 'out': + case 'outlow': + case 'outhigh': + gpioPorts.push(gpioSetting); + break; + case 'button': + buttonPorts.push(gpioSetting); + break; + case 'dht11': + case 'dht22': + dhtPorts.push(gpioSetting); + break; + default: + this.log.error('Cannot setup port ' + gpioSetting.gpio + ': invalid direction type.'); + } + } + + //clean up unsued gpio objects: + for (const id of Object.keys(objects)) { + let num = -1; + if (id.match(/^(rpi2\.\d+\.)?gpio\.\d+$/)) { + if (id.startsWith(this.namespace + '.gpio.')) { + num = parseInt(id.split('.')[3], 10); + } + if (id.startsWith('gpio.')) { + num = parseInt(id.split('.')[1], 10); + } + } + if (num > 0) { + const configuredPort = this.config.gpioSettings.find(g => g.gpio === num); + if (!configuredPort) { + this.log.debug('Deleting unused gpio settings for ' + num); + await this.delObjectAsync(id, {recursive: true}); } } } @@ -127,36 +122,32 @@ class Rpi2 extends utils.Adapter { /** * Create ioBroker Objects for gpio port. - * @param port {number} * @param data {object} from config. * @returns {Promise} */ - async syncPort(port, data) { - data.isGpio = (data.input === 'in' || data.input === 'out' || data.input === 'outlow' || data.input === 'outhigh'); - data.isButton = (data.input === 'button'); - data.isTempHum = (data.input === 'dht11' || data.input === 'dht22'); - data.isInput = (data.input === 'in' || data.isButton || data.isTempHum); - - const channelName = 'gpio.' + port; - if (data.enabled) { - await this.extendObjectAsync(channelName, { - type: 'channel', - common: { - name: data.label === '' ? 'GPIO ' + port : data.label, - // TODO: should we do more than just add this as 'info'? - role: 'info' - } - }); - } + async syncPort(data) { + data.isGpio = (data.configuration === 'in' || data.configuration === 'out' || data.configuration === 'outlow' || data.configuration === 'outhigh'); + data.isButton = (data.configuration === 'button'); + data.isTempHum = /** @type {boolean} */ (data.configuration === 'dht11' || data.configuration === 'dht22'); + data.isInput = /** @type {boolean} */ (data.configuration === 'in' || data.isButton || data.isTempHum); + + const channelName = 'gpio.' + data.gpio; + await this.extendObject(channelName, { + type: 'channel', + common: { + name: data.label === '' ? 'GPIO ' + data.gpio : data.label, + role: 'info' + } + }); - const stateName = 'gpio.' + port + '.state'; - if (data.enabled && data.isGpio) { + const stateName = 'gpio.' + data.gpio + '.state'; + if (data.isGpio) { const obj = { common: { - name: 'GPIO ' + port, + name: 'GPIO ' + data.gpio, type: 'boolean', role: data.isInput ? 'indicator' : 'switch', - read: data.isInput, + read: /** @type {boolean} */ (data.isInput), write: !data.isInput }, native: { @@ -164,37 +155,32 @@ class Rpi2 extends utils.Adapter { type: 'state' }; // extendObject creates one if it doesn't exist - the same below - await this.extendObjectAsync(stateName, obj); + await this.extendObject(stateName, obj); } else { await this.delObjectAsync(stateName); } - await this.syncPortDirection(port, data); - await this.syncPortButton(port, data); - await this.syncPortTempHum(port, data); - - if (!data.enabled) { - await this.delObjectAsync(channelName, {recursive: true}); - } + await this.syncPortDirection(data); + await this.syncPortButton(data); + await this.syncPortTempHum(data); } /** * Create/Delect Object for GPIO button - * @param port {number} * @param data {object} from config * @returns {Promise} */ - async syncPortButton(port, data) { + async syncPortButton(data) { const buttonEventsOLD = [ 'pressed', 'clicked', 'clicked_pressed', 'double_clicked', 'released' ]; for (const eventName of buttonEventsOLD) { - const stateName = `gpio.${port}.${eventName}`; + const stateName = `gpio.${data.gpio}.${eventName}`; await this.delObjectAsync(stateName); } for (const eventName of buttonEvents) { - const stateName = `gpio.${port}.${eventName}`; - if (data.enabled && data.isButton) { + const stateName = `gpio.${data.gpio}.${eventName}`; + if (data.isButton) { const obj = { common: { - name: 'GPIO ' + port + ' ' + eventName, + name: 'GPIO ' + data.gpio + ' ' + eventName, type: 'boolean', role: 'button', read: false, @@ -204,7 +190,7 @@ class Rpi2 extends utils.Adapter { }, type: 'state' }; - await this.extendObjectAsync(stateName, obj); + await this.extendObject(stateName, obj); } else { //await this.delObjectAsync(stateName); //Do not delete 'state' as this is used above. TODO: clean up code, when decided if buttons are ever supported. @@ -214,15 +200,14 @@ class Rpi2 extends utils.Adapter { /** * Create/Delete ioBroker Objects for gpio temperature and humidity. - * @param port {number} * @param data {object} from config * @returns {Promise} */ - async syncPortTempHum(port, data) { - if (data.enabled && data.isTempHum) { + async syncPortTempHum(data) { + if (data.isTempHum) { const obj = { common: { - name: 'GPIO ' + port + ' temperature', + name: 'GPIO ' + data.gpio + ' temperature', type: 'number', role: 'value.temperature', read: true, @@ -232,14 +217,14 @@ class Rpi2 extends utils.Adapter { }, type: 'state' }; - await this.extendObjectAsync(temperatureStateName(port), obj); + await this.extendObject(temperatureStateName(data.gpio), obj); } else { - await this.delObjectAsync(temperatureStateName(port)); + await this.delObjectAsync(temperatureStateName(data.gpio)); } - if (data.enabled && data.isTempHum) { + if (data.isTempHum) { const obj = { common: { - name: 'GPIO ' + port + ' temperature', + name: 'GPIO ' + data.gpio + ' temperature', type: 'number', role: 'value.humidity', read: true, @@ -249,39 +234,34 @@ class Rpi2 extends utils.Adapter { }, type: 'state' }; - await this.extendObjectAsync(humidityStateName(port), obj); + await this.extendObjectAsync(humidityStateName(data.gpio), obj); } else { - await this.delObjectAsync(humidityStateName(port)); + await this.delObjectAsync(humidityStateName(data.gpio)); } } /** * Create ioBroker Objects for gpio button. - * @param port * @param data * @returns {Promise} */ - async syncPortDirection(port, data) { - const stateName = 'gpio.' + port + '.isInput'; - if (data.enabled) { - this.log.debug(`Creating ${stateName}`); - const obj = { - common: { - name: 'GPIO ' + port + ' direction', - type: 'boolean', - role: 'state', - read: true, - write: false - }, - native: { - }, - type: 'state' - }; - await this.extendObjectAsync(stateName, obj); - await this.setStateAsync(stateName, data.isInput, true); - } else { - await this.delObjectAsync(stateName); - } + async syncPortDirection(data) { + const stateName = 'gpio.' + data.gpio + '.isInput'; + this.log.debug(`Creating ${stateName}`); + const obj = { + common: { + name: 'GPIO ' + data.gpio + ' direction', + type: 'boolean', + role: 'state', + read: true, + write: false + }, + native: { + }, + type: 'state' + }; + await this.extendObject(stateName, obj); + await this.setState(stateName, data.isInput, true); } onStateChange(id, state) { @@ -568,32 +548,27 @@ function humidityStateName(port) { // Setup DHTxx/AM23xx sensors function setupDht(adapter, dhtPorts) { if (dhtPorts.length === 0) return; - const pollInterval = adapter.config.dhtPollInterval; - if (pollInterval === 0) { - adapter.log.warn('DHTxx/AM23xx configured but polling disabled'); - } else if (pollInterval < 350) { - adapter.log.error(`DHTxx/AM23xx polling interval seems too short (${pollInterval}) - disabling`); - } else { - // Config is good - const sensorLib = require('node-dht-sensor'); - - // Initialise ports, keeping track of those that worked with type - const dhtInitd = []; - for (const port of dhtPorts) { - const type = adapter.config.gpios[port].input === 'dht11' ? 11 : 22; - try { - sensorLib.initialize(type, port); - dhtInitd[port] = [type]; - } catch (err) { - adapter.log.error(`Failed to initialise DHTxx/AM23xx: ${type}/${port}`); - } - } - if (dhtInitd.length > 0) { - // At least one initialized, set polling on the configured interval + // Initialise ports, keeping track of those that worked with type + const dhtInitd = []; + for (const gpioSetting of dhtPorts) { + const type = gpioSetting.configuration === 'dht11' ? 11 : 22; + try { + const sensorLib = require('node-dht-sensor'); + sensorLib.initialize(type, gpioSetting.gpio); + dhtInitd[gpioSetting.gpio] = [type]; + + let pollInterval = gpioSetting.debounceOrPoll; + if (pollInterval === 0) { + adapter.log.warn('DHTxx/AM23xx configured but polling disabled'); + } + if (pollInterval < 350) { + adapter.log.warn(`DHTxx/AM23xx polling interval seems too short (${pollInterval}) - setting to 350ms`); + pollInterval = 350; + } intervalTimers.push(setInterval(async () => { for (const [port, type] of Object.entries(dhtInitd)) { - sensorLib.read(type, port, async function(err, temperature, humidity) { + sensorLib.read(type, port, async function (err, temperature, humidity) { if (err) { adapter.log.error(`Failed to read DHTxx/AM23xx: ${type}/${port}`); } else { @@ -603,7 +578,9 @@ function setupDht(adapter, dhtPorts) { } }); } - }, pollInterval)); + }, gpioSetting.debounceOrPoll)); + } catch (err) { + adapter.log.error(`Failed to initialise DHTxx/AM23xx: ${type}/${gpioSetting.gpio}`); } } }