-
Notifications
You must be signed in to change notification settings - Fork 43
Fix error year 2026 #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
Why not build on top of other holiday tracker packages, like https://github.com/vacanza/holidays which is the one used in https://www.home-assistant.io/integrations/workday as well? That way maintenance of what constitutes a holiday could be kept out of this package? |
|
I did take the approach of using the https://github.com/vacanza/holidays package in the PR I just published: #83 |
|
As @derallye remarks, not all holidays are included in the regulation: "Se consideran como horas del periodo 3 (valle) todas las horas de los sábados, domingos, el 6 de enero y los días festivos de ámbito nacional, definidos como tales en el calendario oficial del año correspondiente, con exclusión tanto de los festivos sustituibles como de los que no tienen fecha fija.", so holidays is not valid |
|
The period is provided by indicator 1002. It should be better to get it there. I'll try to make a PR with that. |
|
Hey, what is required to merge this? |
|
Hi, The test in test_tariff_attributes.py is failing. It should be changed because the test was checking incorrect holidays dates. From this: aiopvpc/tests/test_tariff_attributes.py Lines 11 to 19 in 59e7aeb
To this:
@derallye , could you commit this change to see the tests may finish ok? |
|
@r-jordan , apologies for the delay. Test fix done. That's ready to be merged. |
The Spanish Regulation (BOE-A-2020-1066 ) states: "Se consideran como horas del periodo 3 (valle) todas las horas de los sábados, domingos, el 6 de enero y los días festivos de ámbito nacional, definidos como tales en el calendario oficial del año correspondiente, con exclusión tanto de los festivos sustituibles como de los que no tienen fecha fija."
That means that it is not required to set the national holidays per year, as the "Viernes Santo" hasn't a fixed date, so it is not included in the list. Just comparing date/month will be enough:
1 January
6 January
1 May
15 August
12 October
1 November
6 December
8 December
25 December
I have fixed the error of missing 2026 national holidays dictionary by changing it to just check for day/month.