Skip to content

Commit

Permalink
* fix done indication
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Apr 16, 2021
1 parent e061964 commit bd4112e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions nodes/ioBroker.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ module.exports = function(RED) {
}
}

node.on('input', msg => {
node.on('input', (msg, send, done) => {
let id = node.topic;
if (!id) {
id = msg.topic;
Expand Down Expand Up @@ -410,7 +410,7 @@ module.exports = function(RED) {
text: 'Cannot set state'
});
}
node.done();
done();
});
}
}
Expand All @@ -434,7 +434,7 @@ module.exports = function(RED) {
text: _id + ': ' + (msg.payload === null || msg.payload === undefined ? '' : msg.payload.toString())
});
}
node.done();
done();
});
} else {
log('State "' + id + '" does not exist in the ioBroker');
Expand All @@ -443,7 +443,7 @@ module.exports = function(RED) {
shape: 'ring',
text: 'State "' + id + '" does not exist in the ioBroker'
});
node.done();
done();
}
});
} else {
Expand All @@ -454,7 +454,7 @@ module.exports = function(RED) {
shape: 'ring',
text: 'Invalid topic name "' + id + '" for ioBroker'
});
node.done();
done();
} else {
setState(id, msg.payload, node.ack, (err, _id) => {
if (err) {
Expand All @@ -471,7 +471,7 @@ module.exports = function(RED) {
text: _id + ': ' + (msg.payload === null || msg.payload === undefined ? '' : msg.payload.toString())
});
}
node.done();
done();
});
}
}
Expand All @@ -482,7 +482,7 @@ module.exports = function(RED) {
shape: 'ring',
text: 'No key or topic set'
});
node.done();
done();
}
});

Expand Down

0 comments on commit bd4112e

Please sign in to comment.