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

Prevent sending values if update too frequent #313

Open
WinndyBoy opened this issue Mar 6, 2018 · 3 comments
Open

Prevent sending values if update too frequent #313

WinndyBoy opened this issue Mar 6, 2018 · 3 comments

Comments

@WinndyBoy
Copy link

I'm updating the SensorDimmer->setPercentage() when a button is held, and currently a message is being sent to the network on every change.

I suggest enhancing the Child::sendValue some how so that if values change quicker than say 5 seconds (configurable) then these messages arn't sent until things have settled. Perhaps the SensorDimmer is a special case and sending messages can be prevented somewhere else, but though I'd mention it for feedback.

@user2684 user2684 added this to the unassigned milestone Mar 10, 2018
@user2684
Copy link
Contributor

I think it makes sense but I'd not touch Child; probably I'd add a sort of debounce at the specific sensor which may suffer from this. Thanks!

@WinndyBoy
Copy link
Author

Thanks for the confirmation, thats what I've done with the SensorDimmer and probably I'll take my changes out and put them into an extended class. Can share later what I did. By sort of debounce do you mean a timer which waits until no changes are made for say 5 seconds and only then writes the value to the ChildInt or other ? This is what I did... or is there another simpler way.

@user2684
Copy link
Contributor

Yes, something like setInterruptDebounce() from #322 which is basically ignoring further interrupts for a given timeframe

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

No branches or pull requests

2 participants