iobroker.acinfinity 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/admin/i18n/de.json +1 -1
- package/admin/i18n/en.json +1 -1
- package/admin/i18n/es.json +1 -1
- package/admin/i18n/fr.json +1 -1
- package/admin/i18n/it.json +1 -1
- package/admin/i18n/nl.json +1 -1
- package/admin/i18n/pl.json +1 -1
- package/admin/i18n/pt.json +1 -1
- package/admin/i18n/ru.json +1 -1
- package/admin/i18n/uk.json +1 -1
- package/admin/i18n/zh-cn.json +1 -1
- package/admin/jsonConfig.json +6 -5
- package/io-package.json +27 -27
- package/lib/constants.js +3 -0
- package/lib/dataModels.js +4 -3
- package/main.js +19 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -205,6 +205,17 @@ Der Adapter erkennt automatisch alle verbundenen Controller und legt den State-B
|
|
|
205
205
|
|
|
206
206
|
## Changelog
|
|
207
207
|
|
|
208
|
+
### 0.9.0 (2026-03-02)
|
|
209
|
+
- Sicherheit: Auth-Token wird nicht mehr in Logs geschrieben
|
|
210
|
+
- Stabilität: Race Condition bei parallelen Re-Login-Versuchen behoben
|
|
211
|
+
- Robustheit: Null-Prüfung für Sensorwerte (verhindert NaN bei nicht angeschlossenen Sensoren)
|
|
212
|
+
- Dokumentation: HTTP-Nutzung der AC Infinity API im Code kommentiert
|
|
213
|
+
- Hinweis: AC Infinity API unterstützt kein HTTPS (serverseitige Einschränkung)
|
|
214
|
+
|
|
215
|
+
### 0.8.5 (2026-03-01)
|
|
216
|
+
- Admin-UI: Hinweistext jetzt rot und fett dargestellt
|
|
217
|
+
- Admin-UI: Minimales Abfrageintervall von 5 auf 10 Sekunden erhöht
|
|
218
|
+
|
|
208
219
|
### 0.8.1 (2026-03-01)
|
|
209
220
|
- Fix: JSON-Syntaxfehler (überschüssiges Komma) in io-package.json behoben
|
|
210
221
|
|
package/admin/i18n/de.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AC Infinity Password": "AC Infinity Passwort",
|
|
6
6
|
"Password used for AC Infinity login": "Passwort für AC Infinity Login",
|
|
7
7
|
"Polling Interval (seconds)": "Abfrageintervall (Sekunden)",
|
|
8
|
-
"Minimum polling interval is
|
|
8
|
+
"Minimum polling interval is 10 seconds.": "Minimales Abfrageintervall beträgt 10 Sekunden.",
|
|
9
9
|
"Note: AC Infinity truncates passwords to 25 characters.": "Hinweis: AC Infinity kürzt Passwörter auf 25 Zeichen.",
|
|
10
10
|
"WARNING": "WARNUNG",
|
|
11
11
|
"This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.": "Dieser Adapter befindet sich in einem frühen Entwicklungsstadium. Sie verwenden diesen Adapter auf eigene Gefahr. Der Autor übernimmt keine Haftung für eventuelle Schäden.",
|
package/admin/i18n/en.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AC Infinity Password": "AC Infinity Password",
|
|
6
6
|
"Password used for AC Infinity login": "Password used for AC Infinity login",
|
|
7
7
|
"Polling Interval (seconds)": "Polling Interval (seconds)",
|
|
8
|
-
"Minimum polling interval is
|
|
8
|
+
"Minimum polling interval is 10 seconds.": "Minimum polling interval is 10 seconds.",
|
|
9
9
|
"Note: AC Infinity truncates passwords to 25 characters.": "Note: AC Infinity truncates passwords to 25 characters.",
|
|
10
10
|
"WARNING": "WARNING",
|
|
11
11
|
"This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.": "This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.",
|
package/admin/i18n/es.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AC Infinity Password": "Contraseña AC Infinity",
|
|
6
6
|
"Password used for AC Infinity login": "Contraseña utilizada para iniciar sesión en AC Infinity",
|
|
7
7
|
"Polling Interval (seconds)": "Intervalo de sondeo (segundos)",
|
|
8
|
-
"Minimum polling interval is
|
|
8
|
+
"Minimum polling interval is 10 seconds.": "El intervalo mínimo de sondeo es de 10 segundos.",
|
|
9
9
|
"Note: AC Infinity truncates passwords to 25 characters.": "Nota: AC Infinity trunca las contraseñas a 25 caracteres.",
|
|
10
10
|
"WARNING": "ADVERTENCIA",
|
|
11
11
|
"This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.": "Este adaptador está en una etapa temprana de desarrollo. Utiliza este adaptador bajo tu propio riesgo. El autor no asume ninguna responsabilidad por cualquier daño.",
|
package/admin/i18n/fr.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AC Infinity Password": "Mot de passe AC Infinity",
|
|
6
6
|
"Password used for AC Infinity login": "Mot de passe utilisé pour la connexion AC Infinity",
|
|
7
7
|
"Polling Interval (seconds)": "Intervalle de sondage (secondes)",
|
|
8
|
-
"Minimum polling interval is
|
|
8
|
+
"Minimum polling interval is 10 seconds.": "L'intervalle de sondage minimum est de 10 secondes.",
|
|
9
9
|
"Note: AC Infinity truncates passwords to 25 characters.": "Remarque: AC Infinity tronque les mots de passe à 25 caractères.",
|
|
10
10
|
"WARNING": "AVERTISSEMENT",
|
|
11
11
|
"This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.": "Cet adaptateur est à un stade précoce de développement. Vous utilisez cet adaptateur à vos propres risques. L'auteur n'assume aucune responsabilité pour tout dommage.",
|
package/admin/i18n/it.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AC Infinity Password": "Password AC Infinity",
|
|
6
6
|
"Password used for AC Infinity login": "Password utilizzata per l'accesso AC Infinity",
|
|
7
7
|
"Polling Interval (seconds)": "Intervallo di polling (secondi)",
|
|
8
|
-
"Minimum polling interval is
|
|
8
|
+
"Minimum polling interval is 10 seconds.": "L'intervallo minimo di polling è di 10 secondi.",
|
|
9
9
|
"Note: AC Infinity truncates passwords to 25 characters.": "Nota: AC Infinity tronca le password a 25 caratteri.",
|
|
10
10
|
"WARNING": "AVVERTENZA",
|
|
11
11
|
"This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.": "Questo adattatore è in una fase iniziale di sviluppo. Usi questo adattatore a tuo rischio e pericolo. L'autore non si assume alcuna responsabilità per eventuali danni.",
|
package/admin/i18n/nl.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AC Infinity Password": "AC Infinity Wachtwoord",
|
|
6
6
|
"Password used for AC Infinity login": "Wachtwoord gebruikt voor AC Infinity login",
|
|
7
7
|
"Polling Interval (seconds)": "Polling interval (seconden)",
|
|
8
|
-
"Minimum polling interval is
|
|
8
|
+
"Minimum polling interval is 10 seconds.": "Minimale polling interval is 10 seconden.",
|
|
9
9
|
"Note: AC Infinity truncates passwords to 25 characters.": "Opmerking: AC Infinity verkort wachtwoorden tot 25 tekens.",
|
|
10
10
|
"WARNING": "WAARSCHUWING",
|
|
11
11
|
"This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.": "Deze adapter bevindt zich in een vroeg ontwikkelingsstadium. U gebruikt deze adapter op eigen risico. De auteur aanvaardt geen aansprakelijkheid voor eventuele schade.",
|
package/admin/i18n/pl.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AC Infinity Password": "Hasło AC Infinity",
|
|
6
6
|
"Password used for AC Infinity login": "Hasło używane do logowania AC Infinity",
|
|
7
7
|
"Polling Interval (seconds)": "Interwał odpytywania (sekundy)",
|
|
8
|
-
"Minimum polling interval is
|
|
8
|
+
"Minimum polling interval is 10 seconds.": "Minimalny interwał odpytywania wynosi 10 sekund.",
|
|
9
9
|
"Note: AC Infinity truncates passwords to 25 characters.": "Uwaga: AC Infinity skraca hasła do 25 znaków.",
|
|
10
10
|
"WARNING": "OSTRZEŻENIE",
|
|
11
11
|
"This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.": "Ten adapter jest we wczesnej fazie rozwoju. Korzystasz z tego adaptera na własne ryzyko. Autor nie ponosi odpowiedzialności za jakiekolwiek szkody.",
|
package/admin/i18n/pt.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AC Infinity Password": "Senha AC Infinity",
|
|
6
6
|
"Password used for AC Infinity login": "Senha usada para login no AC Infinity",
|
|
7
7
|
"Polling Interval (seconds)": "Intervalo de sondagem (segundos)",
|
|
8
|
-
"Minimum polling interval is
|
|
8
|
+
"Minimum polling interval is 10 seconds.": "O intervalo mínimo de sondagem é de 10 segundos.",
|
|
9
9
|
"Note: AC Infinity truncates passwords to 25 characters.": "Nota: AC Infinity trunca senhas para 25 caracteres.",
|
|
10
10
|
"WARNING": "AVISO",
|
|
11
11
|
"This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.": "Este adaptador está em um estágio inicial de desenvolvimento. Você usa este adaptador por sua conta e risco. O autor não assume nenhuma responsabilidade por quaisquer danos.",
|
package/admin/i18n/ru.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AC Infinity Password": "Пароль AC Infinity",
|
|
6
6
|
"Password used for AC Infinity login": "Пароль для входа в AC Infinity",
|
|
7
7
|
"Polling Interval (seconds)": "Интервал опроса (секунды)",
|
|
8
|
-
"Minimum polling interval is
|
|
8
|
+
"Minimum polling interval is 10 seconds.": "Минимальный интервал опроса составляет 10 секунд.",
|
|
9
9
|
"Note: AC Infinity truncates passwords to 25 characters.": "Примечание: AC Infinity сокращает пароли до 25 символов.",
|
|
10
10
|
"WARNING": "ПРЕДУПРЕЖДЕНИЕ",
|
|
11
11
|
"This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.": "Этот адаптер находится на ранней стадии разработки. Вы используете этот адаптер на свой страх и риск. Автор не несет ответственности за возможный ущерб.",
|
package/admin/i18n/uk.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AC Infinity Password": "Пароль AC Infinity",
|
|
6
6
|
"Password used for AC Infinity login": "Пароль для входу в AC Infinity",
|
|
7
7
|
"Polling Interval (seconds)": "Інтервал опитування (секунди)",
|
|
8
|
-
"Minimum polling interval is
|
|
8
|
+
"Minimum polling interval is 10 seconds.": "Мінімальний інтервал опитування становить 10 секунд.",
|
|
9
9
|
"Note: AC Infinity truncates passwords to 25 characters.": "Примітка: AC Infinity скорочує паролі до 25 символів.",
|
|
10
10
|
"WARNING": "ПОПЕРЕДЖЕННЯ",
|
|
11
11
|
"This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.": "Цей адаптер знаходиться на ранній стадії розробки. Ви використовуєте цей адаптер на власний ризик. Автор не несе відповідальності за будь-які збитки.",
|
package/admin/i18n/zh-cn.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AC Infinity Password": "AC Infinity 密码",
|
|
6
6
|
"Password used for AC Infinity login": "用于 AC Infinity 登录的密码",
|
|
7
7
|
"Polling Interval (seconds)": "轮询间隔(秒)",
|
|
8
|
-
"Minimum polling interval is
|
|
8
|
+
"Minimum polling interval is 10 seconds.": "最小轮询间隔为 10 秒。",
|
|
9
9
|
"Note: AC Infinity truncates passwords to 25 characters.": "注意:AC Infinity 将密码截断为 25 个字符。",
|
|
10
10
|
"WARNING": "警告",
|
|
11
11
|
"This adapter is in an early development stage. You use this adapter at your own risk. The author assumes no liability for any damage.": "此适配器处于早期开发阶段。使用此适配器的风险由您自行承担。作者不承担任何损害赔偿责任。",
|
package/admin/jsonConfig.json
CHANGED
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"pollingInterval": {
|
|
26
26
|
"type": "number",
|
|
27
27
|
"label": "Polling Interval (seconds)",
|
|
28
|
-
"help": "Minimum polling interval is
|
|
28
|
+
"help": "Minimum polling interval is 10 seconds.",
|
|
29
29
|
"newLine": true,
|
|
30
|
-
"min":
|
|
30
|
+
"min": 10,
|
|
31
31
|
"default": 30,
|
|
32
32
|
"xs": 12,
|
|
33
33
|
"sm": 6,
|
|
@@ -45,11 +45,12 @@
|
|
|
45
45
|
"lg": 12,
|
|
46
46
|
"xl": 12,
|
|
47
47
|
"style": {
|
|
48
|
-
"color": "#
|
|
49
|
-
"fontSize": "
|
|
48
|
+
"color": "#cc0000",
|
|
49
|
+
"fontSize": "1em",
|
|
50
|
+
"fontWeight": "bold",
|
|
50
51
|
"marginTop": "16px",
|
|
51
52
|
"paddingLeft": "10px",
|
|
52
|
-
"borderLeft": "3px solid #
|
|
53
|
+
"borderLeft": "3px solid #cc0000"
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
}
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "acinfinity",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.9.0": {
|
|
7
|
+
"en": "Security: token no longer logged; fix re-login race condition; null-safe sensor values; HTTP API documented",
|
|
8
|
+
"de": "Sicherheit: Token nicht mehr in Logs; Race Condition bei Re-Login behoben; Null-sichere Sensorwerte; HTTP-API dokumentiert",
|
|
9
|
+
"ru": "Безопасность: токен больше не логируется; исправлена гонка при повторном входе; безопасные сенсорные значения; задокументировано использование HTTP",
|
|
10
|
+
"pt": "Segurança: token não registrado; correção de condição de corrida no re-login; valores de sensor seguros para null; API HTTP documentada",
|
|
11
|
+
"nl": "Beveiliging: token niet meer gelogd; race condition bij re-login opgelost; null-veilige sensorwaarden; HTTP API gedocumenteerd",
|
|
12
|
+
"fr": "Sécurité: token non journalisé; correction de la condition de course à la reconnexion; valeurs capteur sûres pour null; API HTTP documentée",
|
|
13
|
+
"it": "Sicurezza: token non più registrato; race condition nel re-login corretta; valori sensore sicuri per null; API HTTP documentata",
|
|
14
|
+
"es": "Seguridad: token ya no registrado; race condition en re-login corregida; valores de sensor seguros para null; API HTTP documentada",
|
|
15
|
+
"pl": "Bezpieczeństwo: token nie jest już logowany; naprawiono race condition przy ponownym logowaniu; bezpieczne wartości null dla sensorów; API HTTP udokumentowane",
|
|
16
|
+
"uk": "Безпека: токен більше не логується; виправлено race condition при повторному вході; null-безпечні значення сенсорів; HTTP API задокументовано",
|
|
17
|
+
"zh-cn": "安全:不再记录令牌;修复重新登录时的竞争条件;传感器值空值安全;HTTP API已记录"
|
|
18
|
+
},
|
|
19
|
+
"0.8.5": {
|
|
20
|
+
"en": "Admin UI: disclaimer text now red and bold; minimum polling interval increased to 10 seconds",
|
|
21
|
+
"de": "Admin-UI: Hinweistext jetzt rot und fett; minimales Abfrageintervall auf 10 Sekunden erhöht",
|
|
22
|
+
"ru": "Admin UI: текст предупреждения теперь красный и жирный; минимальный интервал увеличен до 10 секунд",
|
|
23
|
+
"pt": "Admin UI: texto de aviso agora vermelho e negrito; intervalo mínimo aumentado para 10 segundos",
|
|
24
|
+
"nl": "Admin UI: disclaimertekst nu rood en vet; minimale polling interval verhoogd naar 10 seconden",
|
|
25
|
+
"fr": "Admin UI: texte d'avertissement maintenant rouge et gras; intervalle minimum augmenté à 10 secondes",
|
|
26
|
+
"it": "Admin UI: testo disclaimer ora rosso e grassetto; intervallo minimo aumentato a 10 secondi",
|
|
27
|
+
"es": "Admin UI: texto de aviso ahora rojo y negrita; intervalo mínimo aumentado a 10 segundos",
|
|
28
|
+
"pl": "Admin UI: tekst zastrzeżeń teraz czerwony i pogrubiony; minimalny interwał zwiększony do 10 sekund",
|
|
29
|
+
"uk": "Admin UI: текст застереження тепер червоний і жирний; мінімальний інтервал збільшено до 10 секунд",
|
|
30
|
+
"zh-cn": "管理界面:免责声明文字现为红色加粗;最小轮询间隔增加至10秒"
|
|
31
|
+
},
|
|
6
32
|
"0.8.1": {
|
|
7
33
|
"en": "Fix: trailing comma in io-package.json news section",
|
|
8
34
|
"de": "Fix: überschüssiges Komma in io-package.json behoben",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "Jakość kodu: migracja do ESLint 9 z @iobroker/eslint-config",
|
|
68
94
|
"uk": "Якість коду: міграція на ESLint 9 з @iobroker/eslint-config",
|
|
69
95
|
"zh-cn": "代码质量:迁移到 ESLint 9 并使用 @iobroker/eslint-config"
|
|
70
|
-
},
|
|
71
|
-
"0.7.1": {
|
|
72
|
-
"en": "Add value ranges to state names for better readability",
|
|
73
|
-
"de": "Wertebereiche zu Datenpunkt-Namen hinzugefügt für bessere Lesbarkeit",
|
|
74
|
-
"ru": "Добавлены диапазоны значений к названиям точек данных",
|
|
75
|
-
"pt": "Intervalos de valores adicionados aos nomes dos pontos de dados",
|
|
76
|
-
"nl": "Waardebereiken toegevoegd aan namen van datapunten",
|
|
77
|
-
"fr": "Plages de valeurs ajoutées aux noms des points de données",
|
|
78
|
-
"it": "Intervalli di valori aggiunti ai nomi dei punti dati",
|
|
79
|
-
"es": "Rangos de valores añadidos a los nombres de los puntos de datos",
|
|
80
|
-
"pl": "Dodano zakresy wartości do nazw punktów danych",
|
|
81
|
-
"uk": "Додано діапазони значень до назв точок даних",
|
|
82
|
-
"zh-cn": "为数据点名称添加了值范围以提高可读性"
|
|
83
|
-
},
|
|
84
|
-
"0.7.0": {
|
|
85
|
-
"en": "Complete rewrite by Claude Code (AI) based on homeassistant-acinfinity; all 8 modes writable; new sensors (CO2/soil/water); only tested with Controller 69 Pro — use at your own risk",
|
|
86
|
-
"de": "Vollständige Neu-Implementierung durch Claude Code (KI) auf Basis von homeassistant-acinfinity; alle 8 Modi schreibbar; neue Sensoren (CO2/Boden/Wasser); nur mit Controller 69 Pro getestet — Nutzung auf eigene Gefahr",
|
|
87
|
-
"ru": "Полная переработка с помощью Claude Code (ИИ) на основе homeassistant-acinfinity; все 8 режимов доступны для записи; новые датчики (CO2/почва/вода); протестировано только с Controller 69 Pro",
|
|
88
|
-
"pt": "Reescrita completa pelo Claude Code (IA) baseada em homeassistant-acinfinity; todos os 8 modos graváveis; novos sensores (CO2/solo/água); testado apenas com Controller 69 Pro",
|
|
89
|
-
"nl": "Volledige herschrijving door Claude Code (AI) op basis van homeassistant-acinfinity; alle 8 modi beschrijfbaar; nieuwe sensoren (CO2/bodem/water); alleen getest met Controller 69 Pro",
|
|
90
|
-
"fr": "Réécriture complète par Claude Code (IA) basée sur homeassistant-acinfinity; tous les 8 modes modifiables; nouveaux capteurs (CO2/sol/eau); testé uniquement avec Controller 69 Pro",
|
|
91
|
-
"it": "Riscrittura completa da Claude Code (AI) basata su homeassistant-acinfinity; tutti gli 8 modi scrivibili; nuovi sensori (CO2/suolo/acqua); testato solo con Controller 69 Pro",
|
|
92
|
-
"es": "Reescritura completa por Claude Code (IA) basada en homeassistant-acinfinity; los 8 modos escribibles; nuevos sensores (CO2/suelo/agua); probado solo con Controller 69 Pro",
|
|
93
|
-
"pl": "Kompletna przebudowa przez Claude Code (AI) na podstawie homeassistant-acinfinity; wszystkie 8 trybów zapisywalnych; nowe czujniki (CO2/gleba/woda); testowane tylko z Controller 69 Pro",
|
|
94
|
-
"uk": "Повна переробка за допомогою Claude Code (ШІ) на основі homeassistant-acinfinity; всі 8 режимів доступні для запису; нові датчики (CO2/ґрунт/вода); протестовано лише з Controller 69 Pro",
|
|
95
|
-
"zh-cn": "由Claude Code(AI)基于homeassistant-acinfinity完全重写;所有8种模式可写;新增传感器(CO2/土壤/水位);仅在Controller 69 Pro上测试"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/lib/constants.js
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
'use strict';
|
|
6
6
|
|
|
7
7
|
// API constants
|
|
8
|
+
// NOTE: The AC Infinity server does NOT support HTTPS. This is a limitation of the
|
|
9
|
+
// AC Infinity infrastructure, not of this adapter. The same applies to the official
|
|
10
|
+
// Home Assistant integration (dalinicus/homeassistant-acinfinity).
|
|
8
11
|
const API_BASE_URL = 'http://www.acinfinityserver.com';
|
|
9
12
|
const API_ENDPOINTS = {
|
|
10
13
|
LOGIN: '/api/user/appUserLogin',
|
package/lib/dataModels.js
CHANGED
|
@@ -26,9 +26,10 @@ class ACInfinityController {
|
|
|
26
26
|
this.deviceType = data.deviceType;
|
|
27
27
|
|
|
28
28
|
// Sensor values (stored as integers representing floating point with 2 decimal places)
|
|
29
|
-
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
29
|
+
// Null check: optional sensors (CO2, soil, water) may be absent in API response
|
|
30
|
+
this.temperature = data.temperature != null ? data.temperature / 100 : null;
|
|
31
|
+
this.humidity = data.humidity != null ? data.humidity / 100 : null;
|
|
32
|
+
this.vpd = data.vpdnums != null ? data.vpdnums / 100 : null;
|
|
32
33
|
|
|
33
34
|
// Process ports
|
|
34
35
|
this.ports = [];
|
package/main.js
CHANGED
|
@@ -31,6 +31,7 @@ class ACInfinity extends utils.Adapter {
|
|
|
31
31
|
this.stateManager = null;
|
|
32
32
|
this.pollingInterval = null;
|
|
33
33
|
this.isConnected = false;
|
|
34
|
+
this.isLoginInProgress = false;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
/**
|
|
@@ -108,11 +109,16 @@ class ACInfinity extends utils.Adapter {
|
|
|
108
109
|
this.log.error(`Error during polling update: ${error.message}`);
|
|
109
110
|
if (error.message.includes('unauthorized') || error.message.includes('auth')) {
|
|
110
111
|
this.log.info('Authentication error detected, attempting to re-login');
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
if (!this.isLoginInProgress) {
|
|
113
|
+
this.isLoginInProgress = true;
|
|
114
|
+
try {
|
|
115
|
+
await this.client.login();
|
|
116
|
+
this.log.info('Re-login successful');
|
|
117
|
+
} catch (loginError) {
|
|
118
|
+
this.log.error(`Failed to re-login: ${loginError.message}`);
|
|
119
|
+
} finally {
|
|
120
|
+
this.isLoginInProgress = false;
|
|
121
|
+
}
|
|
116
122
|
}
|
|
117
123
|
}
|
|
118
124
|
}
|
|
@@ -296,9 +302,14 @@ class ACInfinity extends utils.Adapter {
|
|
|
296
302
|
this.log.info(
|
|
297
303
|
`Not logged in, trying to log in again. isConnected: ${this.isConnected}, isLoggedIn: ${this.client ? this.client.isLoggedIn() : 'client is null'}`,
|
|
298
304
|
);
|
|
305
|
+
if (this.isLoginInProgress) {
|
|
306
|
+
this.log.debug('Login already in progress, skipping duplicate re-login');
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
this.isLoginInProgress = true;
|
|
299
310
|
try {
|
|
300
311
|
await this.client.login();
|
|
301
|
-
this.log.info(
|
|
312
|
+
this.log.info('Re-login successful');
|
|
302
313
|
this.isConnected = true;
|
|
303
314
|
await this.setStateAsync('info.connection', { val: true, ack: true });
|
|
304
315
|
} catch (loginError) {
|
|
@@ -306,6 +317,8 @@ class ACInfinity extends utils.Adapter {
|
|
|
306
317
|
this.isConnected = false;
|
|
307
318
|
await this.setStateAsync('info.connection', { val: false, ack: true });
|
|
308
319
|
throw new Error('Login failed, state change cannot be processed');
|
|
320
|
+
} finally {
|
|
321
|
+
this.isLoginInProgress = false;
|
|
309
322
|
}
|
|
310
323
|
}
|
|
311
324
|
|