Skip to content

Parts Swich (or PushButton?) without polling task #107

@s-celles

Description

@s-celles

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions