Skip to content

Physical Button Can Stop an Alarm #3753

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

voloved
Copy link
Contributor

@voloved voloved commented Feb 22, 2025

Currently, if an alarm is going off, the lockscreen needs to be awaken with the physical button and then Stop must be touched.

This can be tedious, especially if the alarm goes off while driving.

This commit adds the ability to turn off the alarm by pressing the physical button twice (once to wake the watch and once to stop the alarm).

An issue is that this does replicate the showPrompt_Q3 logic for the Bangle 2, which means that this functionality will not work on the Bangle1.

If this is not an option, one nice-to-have is to allow the behavior of the physical button to be mapped to either the Yes or No when calling showPrompt, but that is outside of the scope of this codebase.

@bobrippling
Copy link
Collaborator

Thanks - I suppose this is something we should consider merging into E.showPrompt, like you say. Let's see - tagging @gfwilliams with this being a core app

Closes #3752

@gfwilliams
Copy link
Member

Yes - changing showPrompt in the firmware would be preferable. However it does support using the button press even without your changes, because supplying back as a callback argument works fine, it's just not as nice:

E.showPrompt("Test", {back:function() { 
  Bangle.setUI(); // remove prompt
  g.clear();
  print("Cancel"); 
}}).then(r => {
  print("Button "+r); 
});

Although it's still nicer than redefining showPrompt, and it should work on Bangle.js 1 too. So I'd say if you want this, I'd add it that way for now.

Also I can't really see a reason not to have this behaviour by default? It just makes sense to me, and I can't see anyone's really going to complain about it. Not sure what others think, but I'd be very tempted not to have the option for it at all and just add the behaviour by default.

@dashavoo
Copy link
Contributor

Also I can't really see a reason not to have this behaviour by default? It just makes sense to me, and I can't see anyone's really going to complain about it. Not sure what others think

A flyby comment because the title of this PR caught my eye: I'd suggest that the default action on button press should be to snooze the alarm rather than stop it. The consequences of doing it by accident are less drastic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants