Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A new factory reset process prompting the user to release the button to reset the device to prevent entering the bootloader mode.
factory_reset_initiated_sound
warningfactory_reset_cancelled_sound
soundfactory_reset_confirmed_sound
warningglobal
factory_reset_requested
?, why not simply👉🏻 Good question, I initially did that, but the factory reset is a 22-second press and before that, we have the first audible warning at 10s that already has a
wait_until
block to inform the user that the factory reset was canceled.Because the factory reset is critical, I do not want to have two things running in parallel, especially when the second one is the seeker streaming "Factory reset procedure canceled"
So it is cleaner that way.
If the 22s-press happens, I stop the LED effect and set a global to true.
And I factory reset outside this multi-click.
Here
This global also prevents the streaming of the "Factory reset procedure cancelled". It's either one or the other.
The state of the global is never saved, and always initiated to false.