As part of a personal project for my Pimoroni Presto, I worked up a timezone with DST support library (as well as an ical parser)
While I’m not great with Micropython yet, spent considerable time making it memory efficient and as fast as I could make it. Hopefully it’s of use to some of you.
Included in the repo are some utility scripts to generate and help keep the binary blob data up to date for timezone changes in the future
Here’s a quick shot of the app, since this is my actual work cal, I redacted a few things.
Event color borders change as it moves from future, to upcoming, to current, to past event.
Rear LEDs also change color, alerting upcoming meeting, ongoing, etc. and I think I have an audio alert buzzer to warn of upcoming as well (but also implemented a quiet hours, and since I do most of the work on it then, not sure if that’s working yet). I can swipe left/right to view a few additional pages of events, the datetime at the top is last time it refreshed. The % is free mem.
Swipe up changes between a dark and light theme, pull down implements a forced refresh of data.
This is my first microcontroller/micropython project, and as such I did use AI for troubleshooting and comment cleanup. But a result of several months of tweaking it to get it as efficient as I could, and realizing what a mess ical format is, and why there isn’t generally support for it with a microcontroller….
Very true. I have done something very similar (see: GitHub - bablokb/pico-e-ink-daily: Display Daily Agenda on an E-Ink Display (version for Pico) ) but I leave the iCal processing to a little server process running on my Pi. The server only feeds a suitable json to the Pico, which is only in charge of creating the UI. So this also works on a less powerful Pico of the first generation. I actually use this with Pimoroni’s InkyFrame/InkyImpression line of displays.
I’m also working on adding calendar agenda on my presto dashboard, but I subscribed to my google calendar from home assistant, so now I can get a nice json output from ha to presto (especially since I already had the ha integration done for showing other stuff like temp etc. and controlling lights).
I’m gonna take a look at your timezone code, as that’s something I’m also interested in.
You are indeed brave to tackle iCalendar parsing, particularly with recurrence rules. Of course, there are vanilla Python libraries for iCalendar, but they tend to rely on other libraries, and then you have to face down an entire stack of dependencies.
I have my own Python libraries for the low-level parsing (supporting the general format used by vCalendar, iCalendar and vCard), plus ones for the actual format, with recurrence handling integrated with a framework that actually models the represented data. There’s quite a lot of complexity to deal with.
And then there’s the matter of scheduling events, adding new recurrences, cancelling events, and so on…
Thanks for this project, I edited the code to my own timezone and Google calendar, and added an icon. When I start it from Thonny it works perfect. But when I start it from the app launcher on the Presto it crashes and the Presto goes back to the app launcher. Any idea how to solve this problem?
I also added my wifi to secrets.py, it works for the other wifi examples.
And I also found out that calendar entries on google which repeat every working day, are only shown once a week, on the day where the first entry was set. My solution for now is to set a entry on Monday, repeat it weekly, on on Tuesday, repeat it weekly, and so on.
I still have some other things I want to change but I first try to do that by myself.