GithubHelp home page GithubHelp logo

Comments (11)

mampfes avatar mampfes commented on August 16, 2024

@a-nicholls Sorry, but I didn't understand your actual problem. Recurring events are supported since some days using a library from pypi and I fixed an issue 16 days ago. Could you describe your problem?

from hacs_waste_collection_schedule.

a-nicholls avatar a-nicholls commented on August 16, 2024

Sure created recurring events, and edited recurring exception (like this week)
image

this produces the following ICS file if I download manually
calendar.ics (2).txt

with the following config

configuration.yaml;

waste_collection_schedule:
  sources:
    - name: ics
      args:
        url: !secret waste_collection_schedule_url
        offset: 0

sensor config

- platform: waste_collection_schedule
  name: Bin days
  details_format: upcoming
  value_template: '{{value.types|join(" + ")}} in {{value.daysTo}} days'
  date_template: '{{value.types|join(" + ")}} in {{value.daysTo}} days'

this shows up in home assistant glance card;

image

Doesn't show any blue bin collections, and shows black bin next collection after this week is in 102 days...

from hacs_waste_collection_schedule.

mampfes avatar mampfes commented on August 16, 2024

Hi, the library used for the recurring event handling doesn't like the ics file:

ValueError: RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware

If I remove the "Z" from UNTIL attribute in the RRULE statement (2 times), I get the following results:

    2020-05-28: Refuse black bin
    2020-05-29: Refuse black bin
    2020-06-04: Blue Recycle bin
    2020-06-11: Refuse black bin
    2020-06-18: Blue Recycle bin
    2020-06-25: Refuse black bin
    2020-07-02: Blue Recycle bin
    2020-07-09: Refuse black bin
    2020-07-16: Blue Recycle bin
    2020-07-23: Refuse black bin
    2020-07-30: Blue Recycle bin
    2020-08-06: Refuse black bin
    2020-08-13: Blue Recycle bin
    2020-08-20: Refuse black bin
    2020-08-27: Blue Recycle bin
    2020-09-03: Refuse black bin
    2020-09-04: Refuse black bin
    2020-09-10: Blue Recycle bin

Is this correct?

from hacs_waste_collection_schedule.

a-nicholls avatar a-nicholls commented on August 16, 2024

Well it shows the Blue Recycle bin from your results, but if you compare it from the calendar view that the ics file is generated from above the Thursday 28th May was modified as an exception to the 29th May, so it got the entry as an additional one on Friday 29th May but didn't remove the 28th Occurrence, the same thing happens in 2020-09-03 and 2020-09-04 (when in the UK there is a late summer holiday at the beginning of the week on 2020-08-31)

This link https://icalevents.com/4437-correct-handling-of-uid-recurrence-id-sequence/ provided information about how exceptions are interpretted

from hacs_waste_collection_schedule.

mampfes avatar mampfes commented on August 16, 2024

Thanks for the link, but the problem is that I don't interpret the ics file myself but use 2 libraries instead:

https://pypi.org/project/recurring-ical-events/
https://pypi.org/project/icalendar/

If there is a problem with exceptions is has to be fixed there - or if there is a better library available I could use this instead. But so far I don't know a better one.

from hacs_waste_collection_schedule.

a-nicholls avatar a-nicholls commented on August 16, 2024

Ah - I see from the first link they require test files to be published etc. before they will look at it, I'm quite new to the github stuff (and python!) :)

from hacs_waste_collection_schedule.

mampfes avatar mampfes commented on August 16, 2024

Please let me know if you get any feedback. Maybe there is a hidden configuration option which would fix the issue but I don't know so far.

from hacs_waste_collection_schedule.

mampfes avatar mampfes commented on August 16, 2024

Hi, did you manage to solve your issue? If yes, I would like to close this issue here.

from hacs_waste_collection_schedule.

a-nicholls avatar a-nicholls commented on August 16, 2024

No unfortunately not, I think it's down to the datetime module; raised it as niccokunzmann/python-recurring-ical-events#28 - unless you can provide any additional help to it?

from hacs_waste_collection_schedule.

a-nicholls avatar a-nicholls commented on August 16, 2024

I think the recurring events with the changes are now fixed - not sure if the order of the dates returned by the function matter?

from hacs_waste_collection_schedule.

mampfes avatar mampfes commented on August 16, 2024

OK, thank, then I will close the issue. The order of the returned dates doesn't matter, they will be sorted anyhow.

from hacs_waste_collection_schedule.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.