Skip to content

Commit

Permalink
set status on message receive
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Jan 4, 2019
1 parent 576ce5b commit 6f867f2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions nodes/ccu-get-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ module.exports = function (RED) {
const address = config.iface + '.' + config.channel.split(' ')[0] + '.' + config.datapoint;
value = this.ccu.values[address];
}
this.status({fill: 'green', shape: 'ring', text: String(value)});

if (config.setPropType === 'cmsg') {
Object.assign(msg, value);
this.send(msg);
this.status({fill: 'green', shape: 'ring', text: String(msg.payload)});
} else {
if (config.datapointProperty !== 'all') {
value = value[config.datapointProperty];
Expand All @@ -32,7 +32,6 @@ module.exports = function (RED) {
if (config.setPropType === 'msg') {
RED.util.setMessageProperty(msg, config.setProp, value);
this.send(msg);
this.status({fill: 'green', shape: 'ring', text: String(msg.payload)});
} else if ((this.setPropType === 'flow') || (this.setPropType === 'global')) {
const context = RED.util.parseContextStore(this.setProp);
const target = this.context()[this.setPropType];
Expand All @@ -41,7 +40,6 @@ module.exports = function (RED) {
this.error(err, msg);
} else {
this.send(msg);
this.status({fill: 'green', shape: 'ring', text: String(msg.payload)});
}
});
}
Expand Down

0 comments on commit 6f867f2

Please sign in to comment.