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

Enhancement: Periodic callback when button is held down #72

Open
fastbike opened this issue Sep 22, 2022 · 1 comment
Open

Enhancement: Periodic callback when button is held down #72

fastbike opened this issue Sep 22, 2022 · 1 comment

Comments

@fastbike
Copy link

My use case is for a light switch that normally functions as a momentary switch, but acts as a dim up/dim down switch when it is held for more than 250ms.

So to achieve this I have attached a function for the onPressedFor callback


I would then like another function to be called back every 50 ms so the lighting can be ramped up or down
````    powerButton.onPresseContinuesr(50, keepDimming); // notify the dimmer to move down a level

I have made some changes to a fork of the code. Are you interested in reviewing them for a pull request ?
@fastbike
Copy link
Author

You can see my changes here, feel free to use
fastbike@ed3ad10

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