diff --git a/README.md b/README.md index 691ca875..741ebd08 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,9 @@ Documentation: ## Changelog +### 0.0.2-alpha9 25.05.2020 +* (Black-Thunder) fixed crash when devices are assigned to different floors/areas + ### 0.0.2-alpha8 25.05.2020 * (Black-Thunder) fixed "Swing" of vanes diff --git a/io-package.json b/io-package.json index b308ef5e..ca47f046 100644 --- a/io-package.json +++ b/io-package.json @@ -1,7 +1,7 @@ { "common": { "name": "melcloud", - "version": "0.0.2-alpha8", + "version": "0.0.2-alpha9", "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/lib/melcloudPlatform.js b/lib/melcloudPlatform.js index 6bf4d716..961bd9f7 100644 --- a/lib/melcloudPlatform.js +++ b/lib/melcloudPlatform.js @@ -103,6 +103,7 @@ class MelcloudPlatform { if (jsonObject == null) return; const foundDevices = []; + gthat.deviceObjects.length = 0; // clear main array first before adding new devices for (let b = 0; b < jsonObject.length; b++) { const building = jsonObject[b]; @@ -131,8 +132,6 @@ class MelcloudPlatform { } CreateDevices(building, devices, foundDevices) { - gthat.deviceObjects.length = 0; // clear array first - for (let d = 0; d < devices.length; d++) { const device = devices[d]; const newDevice = new MelCloudDevice.MelCloudDevice(gthat); diff --git a/main.js b/main.js index 647f9fd4..75ffa6c5 100644 --- a/main.js +++ b/main.js @@ -256,8 +256,10 @@ class Melcloud extends utils.Adapter { }); if(device == null) { - this.log.debug("Failed to get device object. Known object ids:"); - this.deviceObjects.forEach(obj => this.log.debug(obj.id)); + let knownIds = ""; + this.deviceObjects.forEach(obj => knownIds += obj.id + ", "); + this.log.error("Failed to get device object. Known object IDs: " + knownIds); + this.log.error("This should not happen - report this to the developer!"); return; } this.log.debug("Processing change for device object with id " + device.id + " (" + device.name + ")..."); diff --git a/package.json b/package.json index 4feb7c5f..98cd249a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.melcloud", - "version": "0.0.2-alpha8", + "version": "0.0.2-alpha9", "description": "melcloud", "author": { "name": "BlackThunder",