Closed schauveau closed 1 year ago
That is remarkable. The first iteration of the Pushbutton
class was published about 9 years ago and ran under a different scheduler. In all that time nobody reported doing that test - it certainly never occurred to me!
Thanks for the report. In the suppress
case it certainly shouldn't happen and I will fix it.
I have pushed a fix. In the case of a short click quickly followed by a long press it now issues the double callback only, regardless of the suppress
arg.
Closing this as I believe this is now fixed. Thanks again for the report.
I have a push button and I am trying to detect short, double and long push. I noticed that if I do a double long push so a double with a long second one then both
double_func
andlong_func
are executed. That behavior contradicts the documentation :I can reproduce it with the 'suppress' example from https://github.com/peterhinch/micropython-async/blob/master/v3/docs/DRIVERS.md#411-the-suppress-constructor-argument
My current workaround is to add a global variable to disable 'long_func' when it happens after a
double_func
without apress_func
.I also tried
pushbutton._ld.stop()
in the double callback but that does not seem to work. Not sure why !!!