-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow toggling an alarm via clkinfo #3579
Conversation
Thanks! The intended function seems to work well. But activating repeatable timers is a bit wonky. Bug with repeatable timersIf a newly set timer has run out and is turned off, if I start it via the clock info entry it will run out again immediately. If I start it after a minute or two it will instead say it will run out in "24h". Reproduce
Other considerations
|
... to ensure timers are scheduled from now
Nice finds! For events, perhaps we ignore these for now so the user can't toggle them, to avoid any confusion. For timers, I've made it so we restart the timer. What do you think? |
I think that's a good idea to make events not toggleable for now - longer term maybe they shouldn't even be displayed in the same clock info? I don't know. Restarting the timer makes sense! Some bugs
|
Yeah I don't know either - I don't use them enough to have a good opinion.
Sweet!
I can't reproduce this - I had the IDE running, tapped on a disabled alarm and noticed that it became enabled -
Similarly, I created an alarm set for 1 minute's time, switched back to the clock and disabled it via clkinfo. The alarm didn't fire and I confirmed (with |
Or perhaps I do 🤔🙃 I can do more testing in a day or two. |
Thanks, and thanks for your testing so far too :) If it helps, I've deployed to my gh-pages too |
I did some more testing - the two problems seem to arise:
I don't see errors in the Web IDE. EDITS:
|
Interesting - I'm GMT+0, shall take a look at whether that could be doing anything. These are the steps I'm following - perhaps I've missed something that brings up the bug? Disabling an alarm
Outcomes:
Enabling an alarm
Outcomes:
|
My outcomes for that disabling flow on factory reset, non-pretokenized apps, fw 2v24,
For this enabeling flow I get the same result as you. |
Test for "Toggling a timer or alarm on through the clock info removed all other alarms, timers and events completely!"
|
Interesting, I'll have a go at that - thanks for the IDE route as well! |
I believe I have this fixed now, back to the original code but with timers working - thanks for your patience, thorough testing and advice, I appreciate it :) To go back to your original questions:
Agreed - I think our two options are to hide the "Delete After Expiration" ones from clkinfo, or leave for now and see?
Yes I think so, I'm no good with icons but I could have a whirl
Sounds good!
I like that idea, I could give that try too - maybe as a separate PR? |
Yes - it seems to work as expected on my end as well! Thanks 😃 Regarding events I think we go a real long way by changing the icon (both in the app and clock info) to something like So maybe we could bring that into this PR and then merge? Or we could do that + change to displaying date in a later PR. What do you think? I also think "day letter" on alarms fits better in a separate PR! :) |
Sweet - I like the look of those icons, gone with the latter which seems to fit in with the others but don't mind changing. I can't seem to get it to show though, I've encoded it as a 1-bit black/white Image String but it doesn't show up for me 🔍 (sorted the text too - left off the year for breverity, let me know what you think) |
I also don't see the icon 🤔 Otherwise - looking good! |
Co-authored-by: thyttan <[email protected]>
What do you say we merge this? |
Sounds good, yes please! |
Thanks 🌸 |
My pleasure - out of interest, do you know how to go from an image string to the image itself? (For getting at some of these images) |
I didn't test this myself but seems like a solution: https://onlinepngtools.com/convert-base64-to-png#tool |
Thanks - it seems I might need a subscription but I've found another method (guessing at the dimensions - I've tried multiple): $ base64 -D < alarm_on.b64 > alarm_on.raw
$ magick -depth 1 -size 8x8 rgb:alarm_on.raw alarm_on.png Except I get back:
Despite: $ ls alarm_on.raw
alarm_on.raw @gfwilliams how do you go from the base64 strings to an image? |
The image format itself is covered in https://www.espruino.com/Graphics#strings - but it's unique to Espruino. You could use imagemagick after skipping the few bytes of header... But what I do is just use Espruino. In the simplest case just draw the image to the screen and dump the contents of the screen (which you can then copy/paste from the IDE console), then manually crop it out:
Or you can create a Graphics instance of the right size and dump that:
|
Ah I see, so the first four bytes are a header in the string-only version, got it. Thanks! |
Yes, but it can vary. If it's not transparent it's only 3 bytes |
No description provided.