Hello,
In a project, we are using push button and Pingo.
Unfortunately Swich class only provides a class with a polling mechanism.
What is your opinion about adding to Switch class some methods that could be used in a non threading context ?
We could have for example attributes such as pressed or released which would return True or False.
I also noticed that it's odd to have such a class named Switch in a file named button.py
CC @lwalter86
I also wonder how this could behave if passed pin at init could come from a GhostBoard.
For unit test, it will be very convenient to add also methods to simulate that a button is being pressed or released.
but.press()
do_something()
but.release()
Kind regards
Hello,
In a project, we are using push button and Pingo.
Unfortunately
Swichclass only provides a class with a polling mechanism.What is your opinion about adding to
Switchclass some methods that could be used in a non threading context ?We could have for example attributes such as
pressedorreleasedwhich would returnTrueorFalse.I also noticed that it's odd to have such a class named
Switchin a file namedbutton.pyCC @lwalter86
I also wonder how this could behave if passed pin at init could come from a GhostBoard.
For unit test, it will be very convenient to add also methods to simulate that a button is being pressed or released.
Kind regards