bruxy70 / Holidays

📅 Custom Home Assistant integration for public holidays - also used for garbage_collection integration to automatically move scheduled events that fall on a public holiday (by an automation blueprint)
MIT License
45 stars 12 forks source link

Holiday Exclusion - Election Day (US) #45

Closed cap60552 closed 1 year ago

cap60552 commented 1 year ago

Before you submit a new bug report, please check that

Is your feature request related to a problem? Please describe.

When building a calendar for my trash pickup, I noticed that I am unable to exclude "Election Day" from the upcoming list of holidays.

Describe the solution you'd like

Add election day to the list of holiday that can be excluded from the holiday list.

Describe alternatives you've considered

Alternatively, provide the ability to enter a list of specific dates to exclude from the calendar.

Additional context

No response

bruxy70 commented 1 year ago

This helper does not define specific holidays for any countries. It merely uses a public library https://github.com/dr-prodigy/python-holidays that defines them. So if you find an error, you can report it there. It will then be automatically corrected here as well. As well as in other entities in Home Assistant.

cap60552 commented 1 year ago

Sorry, I guess I'm not familiar enough with the way the whole thing works. I figured that if the Holiday was showing up on the "Holidays" calendar that "Holidays" was getting the data it needed from the underlying holiday library, but for some reason it was just not listing it on the ignore list in the config.

I'll try to figure out how to word the bug report to the python library once I can figure out how the config flow ignore page in "Holidays" builds the exception list.

bruxy70 commented 1 year ago

It just gets all holidays for the country/subdivision, and creates a list where you can then select the ones you want to pop out. So i guess the issue is, it does not list the election day as a holiday.

cap60552 commented 1 year ago

That is correct. The election day shows in the entity attribute as a holiday, but it never shows up on the exclusion list to be excluded.
Election day exclusion - 2023-01-09 Election Day Entity - 2023-01-09

Having looked over the list of dates, Could this be because the exclusion list is only building from the current year? As there is no Election Day in 2023?

If so, would it be possible to build from multiple years to cover this situation so I don't have to remember to reconfigure the calendar after 1/1/2024? Not sure how many other holidays have this situation where they don't occur in some years.

bruxy70 commented 1 year ago

Should work better in the current release.