diff --git a/README.md b/README.md index f5278faa..cd3ce653 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,9 @@ TODO ## Changelog +### 0.0.X XX.XX.2020 +* (Black-Thunder) fixed check of adapter settings + ### 0.0.2 24.05.2020 * (Black-Thunder) first implementation of device control (all states under "device.XXX.control") * (Black-Thunder) added more device options diff --git a/io-package.json b/io-package.json index e9f345ca..0170f0e4 100644 --- a/io-package.json +++ b/io-package.json @@ -1,7 +1,7 @@ { "common": { "name": "melcloud", - "version": "0.0.2", + "version": "0.0.2-alpha2", "news": { "0.0.2": { "en": "first implementation of device control, added more device options, extended and optimized logging (e.g. when logging into MelCloud), implemented polling of cloud data", diff --git a/main.js b/main.js index 9fe117d9..98936478 100644 --- a/main.js +++ b/main.js @@ -217,7 +217,7 @@ class Melcloud extends utils.Adapter { if (state) { this.log.silly(`state ${id} changed: ${state.val} (ack = ${state.ack})`); - //ack is true when state was updated by MELCloud --> in this case, we don#t need to send it again + // ack is true when state was updated by MELCloud --> in this case, we don't need to send it again if (state.ack) { this.log.silly("Updated data was retrieved from MELCloud. No need to process changed data."); return; @@ -225,6 +225,12 @@ class Melcloud extends utils.Adapter { // listen for changes at "devices.XXX.control" --> device settings/modes are changed if (id.startsWith(this.namespace + "." + commonDefines.AdapterDatapointIDs.Devices) && id.includes("." + commonDefines.AdapterDatapointIDs.Control + ".")) { + + if(this.deviceObjects.length == 0) { + this.log.error("No objects for MELCloud devices constructed yet. Try again in a few seconds..."); + return; + } + let deviceId = id.replace(this.namespace + "." + commonDefines.AdapterDatapointIDs.Devices + ".", ""); deviceId = deviceId.substring(0, deviceId.indexOf(".")); diff --git a/package.json b/package.json index b2d999cf..a9d25d83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.melcloud", - "version": "0.0.2", + "version": "0.0.2-alpha2", "description": "melcloud", "author": { "name": "BlackThunder",