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

[Feature] Make stop button readable #1688

Open
laurensvalk opened this issue Jun 25, 2024 · 1 comment
Open

[Feature] Make stop button readable #1688

laurensvalk opened this issue Jun 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@laurensvalk
Copy link
Member

You can set the stop button combination with hub.system.set_stop_button but not currently read it.

It would be nice if you could read it. Then you can restore it after running code that raises an exception.

We do that in a few places in the firmware right now, but can't currently do that in Python.

@laurensvalk laurensvalk added the enhancement New feature or request label Jun 25, 2024
@dlech
Copy link
Member

dlech commented Jun 25, 2024

Maybe too fancy, but it would be cool if hub.system.set_stop_button() returned a context manager object, then we could write:

with hub.system.set_stop_button(...):
    # main code here
    ...

Everything would be done in a single line rather than having to have a separate getter function and a try/finally block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants