Adding messages to alarm.json?

Posted on
  • I've created an app that lets users create notes using an onscreen keyboard. They can then turn those notes into alarms or timers. When the alarm activates, the note will appear on the screen, along with the usual "sleep" and "ok" buttons. From what I've read from other posts, it's apparently okay to have your app modify alarm.json - I wanted to confirm that it's actually okay? Also, notes created from my app are stored in the "msg" field in alarm.json - and although the default alarm app handles the "msg" field, it doesn't seem to make use of it at all. So my other question is, would adding a "msg" field to alarm.json cause any potential problems? So far from my testing, I could create/modify/delete alarms from either my app or the alarm app without conflicts or problems.

    My app can be seen here: https://frigis1.github.io/BangleApps/?id=noteify

  • There's a work in progress about alarms, take a look here!

  • That sounds great! As @Alessandro mentioned I'll be merging in a 'new' alarm app that should be a lot better, and will provide you with a library to do exactly what you want.

    The onscreen keyboard sounds great. I've been wondering about this - does it make sense to have some kind of 'keyboard' app type that apps could use for text input? I can imagine maybe for Gadgetbridge it might be neat to be able to type a reply to messages, or things like that

  • @Gordon yes, please create a common interface for text input - I already have a WIP mobile phone style keyboard that I intend to get back to soon.

  • does it make sense to have some kind of 'keyboard' app type that apps could use for text input?

    I don't really see myself typing on the watch, but it would be nice if all apps could use E.showKeyboard().then(text => { /* do something */ }).
    That way we can add apps that override it with custom "keyboards" containing canned responses/emoticons.

  • Wowzers, this is huge! Thanks @Gordon and @Alessandro for letting me know. I'll take a look and see about updating my app to the new alarm system.
    I personally wouldn't use an onscreen keyboard all that much (a three or four word reply to a message or note, maybe) but I could imagine one being useful to others. The idea @rigrig has about canned responses would be awesome.

  • Could there be a way for an app to create an alarm that when triggered could load (execute) that app itself to display the alarm, perhaps with the assistance of a common library to provide a consistent user experience?

  • Could there be a way for an app to create an alarm that when triggered could load (execute) that app itself to display the alarm

    Yes - the README on the WIP branch for it is here, but it'll do exactly that: https://github.com/espruino/BangleApps/tree/new_alarm/apps/sched

    Right now there common code, but no common UI because, honestly, the alarm UI isn't great as-is so I imagine it'll want changing soon anyway :)

  • That will teach me to try to catch up on the bus to work! :-) Miss all sorts of things.

    I'm not sure that I like getTimeToAlarm() returning undefined if the alarm is defined, but more than 1 day in the future. If the alarm is going to go off, then it should calculate when in all cases.

    A minor thing - regarding the button labelled "Sleep" - is "Snooze" a more common term for that? That's what my clock radio says, anyway. Sample size of 1...

  • I'm not sure that I like getTimeToAlarm() returning undefined if the alarm is defined

    PRs would be very welcome :) Right now that function isn't used by anything though.

    And yes, good point. We already say 'Auto Snooze' in options. I'll change that.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Adding messages to alarm.json?

Posted by Avatar for frigis1 @frigis1

Actions