add: support for multiple ICS and Google calendars.#115
Conversation
urlib3 version requirements had to be fixed. Also removed deprecated .utcnow()
|
Hi @KaeroDot thanks for the PR and appreciate your time, but apologies, I'm not looking to merge this, the reason is it's bringing the project to a complexity I'm just not comfortable with. It's also making the providers' behaviour mixed, and tbh ICS has been a pain to deal with, so I'm not keen on expanding it. But this does inspire me to consider whether I should ANDing the providers instead of ORing the providers as right now so at the very least thanks for that. |
|
Ok, so I will have to divert my fork. |
|
Ahhhh that's actually a good point. It makes more senseenseand multiple Google calendars than different providers. OK I'll want to think on this a bit more because I also have to think of how I'm going to be testing each time I make changes which would go dramatically up, also want to provide consistency across all providers by allowing multiple. Right now I'm leaning up just stick to single instances like now because it's simpler. OK let me reopen for now while this serves as a feature request: allow multiple instances of calendars from same provider. |
|
Yes, that is the issue of my pull request, I was not able to make the code for all types of providers. But it shows a way how to do it, it is tested for google and ics and it is backward compatible - it will not affect people who use only one calendar. |
|
Alright I've finally got something in progress here: https://github.com/mendhak/waveshare-epaper-display/pull/116/changes I've moved from env.sh to config.toml, this was long overdue anyway. Moving to toml is useful here because it allows for any number of calendar providers in any combination. As part of this I'm having to do some clean up and cache refactoring, so I think it'll take a bit of testing. The key bit here is the config.toml.example file. It's a big change from env.sh but I feel it's necessary anyway, the env.sh was a 'temporary' thing that stuck around for too long |
I have added support for up to 5 google calendars and up to 5 ics calendars. All available calendars are fetched, events sorted and displayed together according the event start date. Personally I need to show up events from 2 google calendars and one ics calendar. I use my own layout with more calendar space (I will share this later).
Unfortunately I haven't got outlook or caldav calendars to test them also.
I had to modify time zone operations so the events from all calendars can be joined into one compatible array and properly sorted. Hopefully I have chosen proper approach.
Additionally, urlib3 version requirements had to be loosened otherwise I got compatibility issues:
The user requested urllib3==2.5.0
icalevents 0.3.0 depends on urllib3>=1.26.5
requests 2.28.1 depends on urllib3<1.27 and >=1.21.1
I have removed deprecated .utcnow().