Skip to content

Commit

Permalink
v0.0.2-alpha2:
Browse files Browse the repository at this point in the history
- fix check of adapter settings
- more logging
  • Loading branch information
Black-Thunder committed May 24, 2020
1 parent 9da4d9e commit 887668e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 7 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,20 @@ 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;
}

// 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("."));

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.melcloud",
"version": "0.0.2",
"version": "0.0.2-alpha2",
"description": "melcloud",
"author": {
"name": "BlackThunder",
Expand Down

0 comments on commit 887668e

Please sign in to comment.