Skip to content

Commit

Permalink
Merge pull request #13 from akomelj/feature/output-message
Browse files Browse the repository at this point in the history
Emit message on output shortly after the configuration is applied
  • Loading branch information
DeanCording authored Jan 6, 2025
2 parents 01d6302 + 60ebf49 commit d8e2e95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ This allows also to alter configurations **manually**.

<a name="output"></a>
### Output ###
The `config` node has no output data.
A message with the current timestamp is emitted to the `config` node's output 100 ms after the configuration is applied.
A short delay is needed for Node RED to finish configuring and wiring the nodes.

<a name="example"></a>
## Example ##
Expand Down
2 changes: 1 addition & 1 deletion config.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h3>Details</h3>
active:{value:true}
},
inputs: 1,
outputs: 0,
outputs: 1,
icon: "inject.png",
label: function() {
return this.name || "Config";
Expand Down
3 changes: 3 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ module.exports = function(RED) {
node.context().global.set(property.p,value);
}
});
setTimeout(function() {
node.send({payload: Date.now()});
}, 100);
};
if (n.active) node.configure(node);

Expand Down

0 comments on commit d8e2e95

Please sign in to comment.