don't add time value to output when not asked for

to Close #399
This commit is contained in:
Dave Conway-Jones
2018-01-28 17:00:48 +00:00
parent d8263eab25
commit 17886b7296
2 changed files with 3 additions and 3 deletions

View File

@@ -49,9 +49,9 @@ module.exports = function(RED) {
else {
payload = payload.toString();
}
payload += node.addCh;
if (node.out === "char") { payload += node.addCh; }
}
else if (node.addCh !== "") {
else if ((node.addCh !== "") && (node.out === "char")) {
payload = Buffer.concat([payload,new Buffer(node.addCh)]);
}
node.port.write(payload,function(err,res) {