From 08d05daecfbc5ed5c8766686fb0f5426c3830fc4 Mon Sep 17 00:00:00 2001 From: Scott Bender Date: Thu, 26 Mar 2026 19:04:02 -0400 Subject: [PATCH] feature: add outputs to send-put node Allows flows to continue after the put is completed --- signalk-send-put.html | 3 ++- signalk-send-put.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/signalk-send-put.html b/signalk-send-put.html index a11ba00..e336ec0 100644 --- a/signalk-send-put.html +++ b/signalk-send-put.html @@ -8,7 +8,8 @@ source: {value:""} }, inputs:1, - outputs:0, + outputs:2, + outputLabels: [ 'success', 'error' ], icon: "bridge.png", align: 'right', label: function() { diff --git a/signalk-send-put.js b/signalk-send-put.js index 711790f..a988354 100644 --- a/signalk-send-put.js +++ b/signalk-send-put.js @@ -33,12 +33,14 @@ module.exports = function(RED) { if ( !app.queryRequest || (reply.state === 'COMPLETED' && reply.statusCode === 200) ) { fill = 'green' text = `value: ${msg.payload}` + node.send([msg, null]) } else if ( reply.state === 'PENDING' ) { fill = 'yellow' text = 'pending...' } else { fill = 'red' text = `error : ${reply.statusCode} ${reply.message || ''}` + node.send([null, msg]) } node.status({fill:fill,shape:"dot",text:text}) })