Skip to content

adamehirsch/tidbyt-icalendar

Repository files navigation

ICS Calendar Events on a Tidbyt

I wanted to be able to put events from several of my family's shared calendars up on our Tidbyt, so I wrote a thing to do it. It polls a list of ICS (icalendar) files, figures out what events are coming up in the next N hours (defaulting to 24). It makes those events into an animated gif and sends it to your Tidbyt display using the official Tidbyt API. If there are no events, it removes itself from your display until the next time you run it and have something coming up.

What you'll need

  • a working python, version 3.9 or higher (specified in python-poetry)
  • the python modules listed in pyproject.toml (I'm using python-poetry)
  • a config/secrets file called tidbyt.yaml, with the following values in it:
    • tidbyt_installation: the installation ID for the app you're installing, which can be any arbitrary string
    • tidbyt_id: the ID of your Tidbyt display, as acquired from your Tidbyt mobile app
    • tidbyt_key: the authentication key for your Tidbyt, also acquired from your Tidbyt mobile app
    • font: (defaults to fonts/4x6.pil) path to the font to use while drawing the images
    • number_of_lines: (defaults to 4) how many lines of teeny text to put on the images
    • calendars: a list of URLs to ICS (iCalendar) records you'd like the script to look at when it runs
      • If you're using Google Calendar, you'll find that individual calendars have a settings value called "Secret Address in iCal format" -- that's what I'm using here.

How to use it

Run grab_events.py. Optionally add a --hours N argument, where N is the number of hours in the future to look ahead for events. If all goes well, the script will fetch down your events, sort them chronologically, and put some animated gifs on your Tidbyt rotation. If you want to test it and have no events in the next 24 hours, try running it with a longer duration to pick up more events.

I run it at 6 a.m. and 6 p.m. local time, from a cron job. That way when my family sits to dinner, we can see upcoming events.

Miscellaneous details

About

Read calendar details and display on our home Tidbyt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages