Skip to content

Commit

Permalink
Fix passthrough
Browse files Browse the repository at this point in the history
Update to 0.0.4
  • Loading branch information
Sineos committed Mar 24, 2023
1 parent 5a8187c commit 04db5d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-timeouttrigger",
"version": "0.0.3",
"version": "0.0.4",
"description": "This node will pipe any received `msg` to its output. At the same time a time-out interval is set. Upon time-out a defined payload is send. Each new message will reset the time-out.",
"main": "timeouttrigger.js",
"scripts": {},
Expand Down
5 changes: 5 additions & 0 deletions timeouttrigger.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
typeField: $("#node-input-ontimeouttype"),
types:['str','num','bool']
});

if (typeof this.passthrough === 'undefined'){
this.passthrough = true;
$("#node-input-passthrough").prop('checked', true);
}
}
});
</script>
Expand Down
3 changes: 2 additions & 1 deletion timeouttrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function(RED) {
this.duration = n.duration || 5;
this.ontimeoutval = n.ontimeoutval || '0';
this.ontimeouttype = n.ontimeouttype || 'str';
this.passthrough = n.passthrough || true;
this.passthrough = n.passthrough;

if (this.duration <= 0) {
this.duration = 0;
Expand Down Expand Up @@ -58,6 +58,7 @@ module.exports = function(RED) {
send = send || function() {
node.send.apply(node, arguments);
};

if (this.passthrough) {
send(msg);
}
Expand Down

0 comments on commit 04db5d0

Please sign in to comment.