From a815e8ead2c88b8626b03845b2f664aed3b3e1f8 Mon Sep 17 00:00:00 2001 From: Moritz Heusinger Date: Sun, 31 Jan 2021 10:25:35 +0100 Subject: [PATCH] chore: release v3.0.15 Ensure that objects are created if something (devices, variables, programs) created during runtime (fixes #124) --- README.md | 3 +++ hm-rega.js | 19 +++++++++++++++++++ io-package.json | 26 +++++++++++++------------- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 37 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index a9b63f2..ffef027 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,9 @@ with the ioBroker CLI. You can change the port via `iob set hm-rega. - ### __WORK IN PROGRESS__ --> +### 3.0.15 (2021-01-31) +* (foxriver76) Ensure that objects are created if something (devices, variables, programs) created during runtime (fixes #124) + ### 3.0.14 (2021-01-30) * (foxriver76) fix pot. crash after reconnect because of existingStates array diff --git a/hm-rega.js b/hm-rega.js index 43a292b..551c506 100644 --- a/hm-rega.js +++ b/hm-rega.js @@ -446,6 +446,12 @@ async function pollVariables() { setTimeout(pollServiceMsgs, 1000); } + if (!objects[fullId]) { + adapter.log.info(`Variable received for not-known dp ${id}, requesting Variables`); + await getVariables(); + return; + } + if (!states[fullId] || !states[fullId].ack || states[fullId].val !== val || (states[fullId].ts && states[fullId].ts !== timestamp)) { states[fullId] = {val: val, ack: true, ts: timestamp}; try { @@ -598,6 +604,13 @@ async function pollPrograms() { const val = data[dp].Active; const fullId = `${adapter.namespace}.${id}.Active`; + + if (!objects[fullId]) { + adapter.log.info(`Program received for not-known dp ${id}, requesting programs`); + await getPrograms(); + return; + } + if (!states[fullId] || !states[fullId].ack || states[fullId].val !== val @@ -647,6 +660,12 @@ async function pollServiceMsgs() { id = `hm-rpc.${instanceNumber}.${id.replace(':', '.').replace(FORBIDDEN_CHARS, '_')}_ALARM`; + if (!objects[id]) { + adapter.log.info(`Alarm DP received for not-known dp ${id}, requesting Service Messages`); + await getServiceMsgs(); + return; + } + const state = { val: data[dp].AlState, ack: true, diff --git a/io-package.json b/io-package.json index 4542125..5476155 100644 --- a/io-package.json +++ b/io-package.json @@ -2,8 +2,20 @@ "$schema": "https://raw.githubusercontent.com/foxriver76/ioBroker.js-controller/schemas/schemas/io-package.json", "common": { "name": "hm-rega", - "version": "3.0.14", + "version": "3.0.15", "news": { + "3.0.15": { + "en": "Ensure that objects are created if something (devices, variables, programs) created during runtime (fixes #124)", + "de": "Stellen Sie sicher, dass Objekte erstellt werden, wenn zur Laufzeit etwas (Geräte, Variablen, Programme) erstellt wurde (Fixes # 124).", + "ru": "Убедитесь, что объекты созданы, если что-то (устройства, переменные, программы) было создано во время выполнения (исправления # 124)", + "pt": "Certifique-se de que os objetos sejam criados se algo (dispositivos, variáveis, programas) for criado durante o tempo de execução (correções # 124)", + "nl": "Zorg ervoor dat objecten worden gemaakt als er iets (apparaten, variabelen, programma's) is gemaakt tijdens runtime (fixes # 124)", + "fr": "Assurez-vous que les objets sont créés si quelque chose (périphériques, variables, programmes) est créé pendant l'exécution (corrections # 124)", + "it": "Assicurati che gli oggetti vengano creati se qualcosa (dispositivi, variabili, programmi) viene creato durante il runtime (correzioni # 124)", + "es": "Asegúrese de que los objetos se creen si algo (dispositivos, variables, programas) se crea durante el tiempo de ejecución (arreglos # 124)", + "pl": "Upewnij się, że obiekty są tworzone, jeśli coś (urządzenia, zmienne, programy) zostały utworzone w czasie wykonywania (poprawki # 124)", + "zh-cn": "确保在运行时创建某些对象(设备,变量,程序)时创建对象(修复程序#124)" + }, "3.0.14": { "en": "fix pot. crash after reconnect because of existingStates array", "de": "Topf reparieren. Absturz nach erneuter Verbindung aufgrund des vorhandenen State-Arrays", @@ -231,18 +243,6 @@ "es": "problemas potenciales solucionados con la escala de valores de porcentaje", "pl": "naprawiono potencjalne problemy ze skalowaniem wartości%", "zh-cn": "修正了%值缩放的潜在问题" - }, - "2.6.14": { - "en": "fixed potential problem on enum sync", - "de": "Mögliches Problem bei der Enum-Synchronisierung behoben", - "ru": "исправлена потенциальная проблема при синхронизации перечислений", - "pt": "problema potencial fixo na sincronização enum", - "nl": "Potentieel probleem opgelost met enum sync", - "fr": "correction d'un problème potentiel sur la synchronisation enum", - "it": "risolto potenziale problema sulla sincronizzazione enum", - "es": "problema potencial solucionado en la sincronización de enumeración", - "pl": "naprawiono potencjalny problem z synchronizacją enum", - "zh-cn": "修复了枚举同步的潜在问题" } }, "title": "HomeMatic ReGaHSS", diff --git a/package-lock.json b/package-lock.json index 546104b..8fa8e67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "iobroker.hm-rega", - "version": "3.0.14", + "version": "3.0.15", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b4ad0c8..6291f2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.hm-rega", - "version": "3.0.14", + "version": "3.0.15", "engines": { "node": ">=10.0.0" },