Period option + control 'reset' behaviour #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello @eisbehr-,
It is me again ... I have added two functionalities to your node. It would be great if you could review it, and give me some feedback. Thanks in advance !
Kind regards,
Bart
Change 1 - added a 'period' option
I'm using my NR flow for live streaming images from my IP camera. As soon as a pir sensor detects motion I want to create a movie of 10 seconds of the same room. To accomplish this, I have added a 'period' option to your node: it passes all messages in the first 10 seconds (after a reset message).
When a reset message arrives, it will again start counting from 0 to N seconds ...
Change 2 - control 'reset' message behaviour
When a 'reset' field is added, your node can be controlled smoothly. However, I needed to be able to specify whether this message should be skipped (i.e. it will never appear on the output) or not (i.e. it will appear on the output like all other non-reset messages). This way I can have pure reset messages (without a real payload), that are only relevant for resetting the node.
Remark: In your latest version, you processed the reset after you processed the message itself. E.g. following order:
In my setup I did all reset handling at the start, to put all reset handling code at a single location (line 48):
This means the reset is executed before the message processing. You can move the initialize call to the end of the function, if you want the same behaviour as in your latest version ...