Skip to content

Twenties: refactor to use the scheduling library instead of its own timeouts#4231

Draft
thyttan wants to merge 29 commits into
espruino:masterfrom
thyttan:twenties
Draft

Twenties: refactor to use the scheduling library instead of its own timeouts#4231
thyttan wants to merge 29 commits into
espruino:masterfrom
thyttan:twenties

Conversation

@thyttan

@thyttan thyttan commented May 25, 2026

Copy link
Copy Markdown
Collaborator

Work in progress.

Try the current iteration at: https://thyttan.github.io/BangleApps/?id=twenties

@elfehr

elfehr commented Jun 1, 2026

Copy link
Copy Markdown

Thanks for working on that!
Maybe you could add msg: "Twenties" to the alarm, to make it clear where it comes from so users are less likely to delete it? I wonder if there is a way to hide it completely or make it undeletable. Or maybe recreating it on boot if it has been deleted?

For curiosity, how are you testing the code in the IDE? On my side, it doesn't read the file from storage correctly, and if I upload the unminified javascript (either to RAM or to storage, replacing the original), I have an error that sched is not found and exports is not defined.

@thyttan

thyttan commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

if I upload the unminified javascript (either to RAM or to storage, replacing the original), I have an error that sched is not found and exports is not defined.

I get those as well, but it works anyways. When the code runs on the watch it will find the sched library file and use it (if you installed it before). But it's probably good to get that error when uploading so you know to get the library if you haven't already.

The exports not being defined is similar in that when running on the watch it will work. Maybe the Web IDE should be made to not fire that error? @gfwilliams

@thyttan

thyttan commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

I wonder if there is a way to hide it completely or make it undeletable.

Yes I think that makes sense. Gordon and I discussed it some in #4217

Or maybe recreating it on boot if it has been deleted?

I did that before. I prefer to avoid it. But maybe it makes sense.

@gfwilliams

Copy link
Copy Markdown
Member

Or maybe recreating it on boot if it has been deleted?

I think if we can hide it with hidden:true in the alarm, it would pretty much solve the problem without having to worry about that.

Maybe the Web IDE should be made to not fire that error?

Well, it's only a warning. It's hard because in most non-Bangle.js devices it's pretty helpful.

It's a bit of a pain to work around, but in the dev IDE (https://espruino.github.io/EspruinoWebIDE/) I've just added a change that means it'll now search Storage for modules when you connect to a device, which should fix this at the expense of a slightly longer connection time.

thyttan added 21 commits June 4, 2026 17:39
setting an alarm at a time that had already occurred today would fire
immediately instead of be scheduled for tomorrow.
(I think that was the problem at least.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants