Skip to content

Commit

Permalink
Add node status for request and response
Browse files Browse the repository at this point in the history
  • Loading branch information
bnystrom committed Sep 19, 2018
1 parent 643ae37 commit 5f15740
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ocpp/ocpp-cp-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ module.exports = function(RED) {

});

node.status({fill: 'green', shape: 'dot', text: `message in: ${msg.ocpp.command}`});
debug(`message in: ${msg.ocpp.command}`);
node.send(msg);
} else if (msgParsed[msgType] == CALLRESULT) {

Expand All @@ -136,6 +138,8 @@ module.exports = function(RED) {
msg.ocpp.command = 'unknown';
}

node.status({fill: 'green', shape: 'dot', text: `response in: ${msg.ocpp.command}`});
debug(`response in: ${msg.ocpp.command}`);
node.send(msg);

}
Expand Down Expand Up @@ -201,6 +205,7 @@ module.exports = function(RED) {
logData(messageTypeStr[request[msgType]], JSON.stringify(request).replace(/,/g, ', '));

debug(`Sending message: ${request[msgAction]}, ${request}`);
node.status({fill: 'green', shape: 'dot', text: `request out: ${request[msgAction]}`});

ws.send(JSON.stringify(request));
}
Expand Down

0 comments on commit 5f15740

Please sign in to comment.