support
support copied to clipboard
[Feature] Make stop button readable
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.
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.