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
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
2 changed files with 3 additions and 3 deletions

View File

@ -49,9 +49,9 @@ module.exports = function(RED) {
else { else {
payload = payload.toString(); 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)]); payload = Buffer.concat([payload,new Buffer(node.addCh)]);
} }
node.port.write(payload,function(err,res) { node.port.write(payload,function(err,res) {

View File

@ -1,6 +1,6 @@
{ {
"name" : "node-red-node-serialport", "name" : "node-red-node-serialport",
"version" : "0.6.2", "version" : "0.6.3",
"description" : "Node-RED nodes to talk to serial ports", "description" : "Node-RED nodes to talk to serial ports",
"dependencies" : { "dependencies" : {
"serialport" : "^6.0.4" "serialport" : "^6.0.4"