RogerSelwyn / O365-HomeAssistant

Office 365 integration for Home Assistant
MIT License
195 stars 15 forks source link

Calendar Filter - Not removing events based on list of exclusion #211

Closed dallombra closed 7 months ago

dallombra commented 7 months ago

Hello, I've tried many different formatting for the 'calendar - exclude' feature, in order to remove events that contains this string: (via Café)

No matter what I tried and I also searched a lot online, I can't figure out the correct way to write the exclusion code in the yaml configuration.

RogerSelwyn commented 7 months ago
    exclude:
     - "(via Café)"
dallombra commented 7 months ago

thanks for the suggestion, but that didn't work either...does the filter need some wildcard (i.e. */%) in order to work?

The actual calendar event would have a longer name, with the portion in bracket being just the last part: so the event would be "XXXX XXXX (via Café)"

RogerSelwyn commented 7 months ago

I'm afraid it works fine in my environment. Do you have any errors in your logs?

- cal_id: redacted
  entities:
  - device_id: HA Test
    end_offset: 672
    name: HA Test
    start_offset: -24
    track: true
    exclude:
     - "(via Café)"
Screenshot 2024-03-04 at 09 54 08 Screenshot 2024-03-04 at 09 56 51 Screenshot 2024-03-04 at 09 55 18
dallombra commented 7 months ago

Could it be related to the fact that the events I'm trying to filter are All-day events and not regularly timed events?

RogerSelwyn commented 7 months ago

Int shouldn't do, but I'll take a look when I get a chance.

RogerSelwyn commented 7 months ago

Had a moment. No, that still works fine. Any errors in your logs?

dallombra commented 7 months ago

No errors in the logs.

I've tried like the below as well, in case the "é" was the issue, still all events are showing up.

 entities:
  - device_id: Calendar
    end_offset: 24
    name: Calendar
    track: true
    exclude:
     - "(via Caf"
RogerSelwyn commented 7 months ago

Sorry, I can't see why to doesn't work for you. I'd have to provide a debug version. Probably tomorrow...

dallombra commented 7 months ago

Found the issue! Sorry I have many calendars in the Yaml and I didn't notice that the one I was trying to filter was somehow duplicated in the config file.

I had applied the filtering only on the first instance, without realising there was a second copy below that was effectively overwriting the filter!

All sorted. Thanks for the help.

RogerSelwyn commented 7 months ago

Delete the second one. Somehow, sometimes it gets duplicated...

dallombra commented 7 months ago

Indeed that's what I did and it works perfectly now!