mendhak / waveshare-epaper-display

At-a-glance dashboard for Raspberry Pi with a Waveshare ePaper 7.5 Inch HAT. Date/Time, Weather, Alerts, Google/Outlook Calendar
https://code.mendhak.com/raspberrypi-epaper-dashboard/
438 stars 65 forks source link

Question: More than one calendar #68

Closed mjimeneznet closed 8 months ago

mjimeneznet commented 8 months ago

Hi! Is possible to have to option to use multiple ICS calendars merging them into the view? Like when you go to your Google Calendar and you see yours, and also events from other calendars.

mendhak commented 8 months ago

Hi that's not possible, it's only one calendar and one calendar type. If you had to hack something together yourself you could make multiple calls over here:

https://github.com/mendhak/waveshare-epaper-display/blob/master/screen-calendar-get.py#L98

and combine the calendar_events so it's one big list.

KaeroDot commented 8 months ago

Hi, I am adding support for multiple calendars. Now I got up to 5 ICS calendars, and up to 5 Google calendars, and all can be combined with Outlook/CalDav calendars.

Please take a look at my branch: https://github.com/KaeroDot/waveshare-epaper-display/tree/multicalendar

Be aware it is still work in progress. Up to now I have tested only multiple ICS calendars and one Google calendar. Unfortunately I haven't got any Outlook and CalDav calendars. It would help to know some public calendars so I can test it fully.

mendhak commented 8 months ago

Hey that's looking good. Please note though I'm not looking to add multiple calendar support to this repo because I'd like to keep the logic and maintenance simple, and the screens are small anyway. But I might look to do something like combine providers and maybe even include task APIs, but not multiple instances of the same type, that's pretty advanced.

KaeroDot commented 8 months ago

Yes, the env.sh is quite complex now and I am not sure an average user would set everything correctly for multiple calendars. The logic for multiple calendars in the .py scripts is quite simple, the function sorted(..., key=attrgetter('start')) merges multiple calendars together nicely. Only the google calendar returns dates without timezone, so this had to be fixed so all can be always sorted.

Ad the small screen - it depends. I need to use 2 google calendars, mine and my wife's (split because of historical reasons), and a public ICS calendar with czech holidays. The total number of events is not big, so even the small display can easily show whole week ahead, and that is more than sufficient for me.

I believe your's env.sh.sample should be reordered a little and example for caldav should be added, this would help first time users.

mendhak commented 8 months ago

Oh yeah good point I missed those, I've gone through the env.sh and rearranged two sections and added ICS and CALDAV examples in there.

KaeroDot commented 7 months ago

Hi! Is possible to have to option to use multiple ICS calendars merging them into the view? Like when you go to your Google Calendar and you see yours, and also events from other calendars.

So, I have tested also calendars from multiple google accounts (multiple json credentials) and it works also.