Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[suggestion] initialState may need to be filtered when sent to change state ? #15

Open
bonjour81 opened this issue Dec 14, 2019 · 0 comments

Comments

@bonjour81
Copy link

bonjour81 commented Dec 14, 2019

Hi !

I just faced an issue with "change state" node
I wanted to used initialState to re-set my alarm state after a node red restart.

So I just add a switch node between a "state changed" and "change state" block to filter on initialState = true.

The issue is that the initialState property pass through the switch and is saved by "change state" node....so once re-started, the "state changed" node will keep sending initialState=true....

I added a "change" node to delete initialState after my switch filter, but that behavior is a bit dangerous (as it trigger the infinite loop mentionned in readme).

By the way, I added a delay block in the loop, configured as rate limiter. this helps a lot in case of infinite loop: the machine will not be frozen with 100% CPU load.

it may be nice to integrate the initialState delete in "change state" ?

Also, I would suggest either (if possible), add a little rate limiter inside the "state changed" node, or maybe this could be recommended to add a delay configured as rate limiter in the readme file.

I'm not sure if there are any issue with those proposal, just some though and (little) experience I wanted to share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant