Close

Rev 3 - Google Calendar

A project log for MiFrame - Yet Another (Raspberry) Pi Smart Frame

MiFrame is a Python Smart Photo Frame application. Supports sharing database across multiple frames, marking favorites, thumbs up etc

tklenketklenke 03/08/2017 at 05:170 Comments

Google calendar integration is live in the kitchen!

I started with the Google Calendar API quickstart https://developers.google.com/google-apps/calendar/quickstart/python and got that running on it's own. That was pretty straight forward, just pay attention to the credentials recipe on that page. Once I got the API running on my dev machine, I took a close look at SmartHouse implementation of the news feed. The way I wanted to display our calendar items is similar to how they did the news stories. I started with that framework and pretty much just plugged in the relevant sections of the quickstart.py code.

I didn't really like how the date was displayed, so I google-fu ed a function to display the date as "March 5th" "May 2nd" etc.

When displaying a landscape photo, there really isn't too much space on the right side. Instead of changing the font size, I just hide the upcoming calendar events when displaying a landscape photo. How I hacked getting a pointer to the switch function seems very kludgy, maybe some pythonic savant can refactor that for me. Eventually, I'd like to put the weather in that tight vertical space.

I've hardcoded the time between updates of the calendar to be 30 minutes.

Discussions