Skip to content
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

Workday: unexpected repairs after upgrading to 2024.9.3 #126688

Closed
Fischelsberger opened this issue Sep 24, 2024 · 10 comments
Closed

Workday: unexpected repairs after upgrading to 2024.9.3 #126688

Fischelsberger opened this issue Sep 24, 2024 · 10 comments

Comments

@Fischelsberger
Copy link

The problem

Seems to be the same issue (#108095) maybe?
Getting a lot of repair prompts like Configured named holiday 2025-08-15 for Workday Sensor does not exist.

Screenshot of the original issue are quite the same on my End here in the current version

What version of Home Assistant Core has the issue?

core-2024.9.3

What was the last working version of Home Assistant Core?

core-2024.9.2

What type of installation are you running?

Home Assistant Container

Integration causing the issue

workday

Link to integration documentation on our website

https://www.home-assistant.io/integrations/workday

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

homeassistant  | 2024-09-24 21:38:54.409 WARNING (MainThread) [homeassistant.components.workday] No holiday found matching datetime.date(2024, 8, 15)
homeassistant  | 2024-09-24 21:38:54.412 WARNING (MainThread) [homeassistant.components.workday] No holiday found matching datetime.date(2025, 8, 15)
homeassistant  | 2024-09-24 21:38:54.413 WARNING (MainThread) [homeassistant.components.workday] No holiday found matching datetime.date(2026, 8, 15)
homeassistant  | 2024-09-24 21:38:54.414 WARNING (MainThread) [homeassistant.components.workday] No holiday found matching datetime.date(2027, 8, 15)
homeassistant  | 2024-09-24 21:38:54.415 WARNING (MainThread) [homeassistant.components.workday] No holiday found matching datetime.date(2028, 8, 15)

Additional information

No response

@home-assistant
Copy link

Hey there @fabaff, @gjohansson-ST, mind taking a look at this issue as it has been labeled with an integration (workday) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of workday can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign workday Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


workday documentation
workday source
(message by IssueLinks)

@gjohansson-ST
Copy link
Member

You need to provide your full config (how the config entry was setup) to be able to provide some feedback on why you see this repairs.

@Fischelsberger
Copy link
Author

Sure thing:
Setup:
grafik

Repair:
grafik

@gjohansson-ST
Copy link
Member

Thanks. I have an idea why it's raising repairs as we're not loading dates for such long into the future. I will give it a test in the upcoming days and see what I can figure out 👍

@Fischelsberger
Copy link
Author

Hey there,

by the way, it worked with 2024.9.2, so was there really a change in "loading dates in the future" as mentined by you?
I've just tested it with a compleatly new vanilla instance, sme issue with just one Date 2024-09-30 added:
grafik

grafik

@gjohansson-ST
Copy link
Member

Hmm. No, there was bump of the package in between. I need to check.

@gjohansson-ST
Copy link
Member

So I took a look at this and while I found out we need to expand the check into the future years, there is not really a problem here as the dates you have provided above are no holiday dates and therefore obviously it can't remove them.
Below is a list of all the holidays for 2025 in Germany, BY. So why remove 2025-08-15 when it doesn't exist?

I guess there is something you want to achieve with that date and maybe it's better if you provide me with your use-case and I can guide you.

(datetime.date(2025, 1, 1), 'Neujahr')
(datetime.date(2025, 4, 18), 'Karfreitag')
(datetime.date(2025, 4, 21), 'Ostermontag')
(datetime.date(2025, 5, 1), 'Erster Mai')
(datetime.date(2025, 5, 29), 'Christi Himmelfahrt')
(datetime.date(2025, 6, 9), 'Pfingstmontag')
(datetime.date(2025, 10, 3), 'Tag der Deutschen Einheit')
(datetime.date(2025, 12, 25), 'Erster Weihnachtstag')
(datetime.date(2025, 12, 26), 'Zweiter Weihnachtstag')
(datetime.date(2025, 1, 6), 'Heilige Drei Könige')
(datetime.date(2025, 6, 19), 'Fronleichnam')
(datetime.date(2025, 11, 1), 'Allerheiligen')

@Fischelsberger
Copy link
Author

Hmm,

Little background for 15th of August: (https://en.wikipedia.org/wiki/Assumption_of_Mary)
In Bavaria it's quite an odd one, because it's only valid in catholic cities (more then 50% catholics living there), in cities with less then 50%, it's not a holiday.

I've just tried to reproduce it with an empty 2024.9.2 instance:
grafik

I've created two workday integrations:
grafik

Workday basic:
grafik

Workday w/o 15th August:
grafik

running the workday.check_date service:

action: workday.check_date
target:
  entity_id:
    - binary_sensor.workday_basic
    - binary_sensor.workday_w_o_15th_august
data:
  check_date: "2025-08-15"

result:

binary_sensor.workday_basic:
  workday: false
binary_sensor.workday_w_o_15th_august:
  workday: true

Same config after upgrade to 2024.9.3:
workday_w_o_15th_august is now wanting to "repair" again.

result:

binary_sensor.workday_w_o_15th_august:
  workday: true
binary_sensor.workday_basic:
  workday: true

IMO, that looks more like an issue with python holidays, than with this integration right now.

I've just tried it with 2 venvs holidays==0.56 and holidays==0.57:
run.sh:

#!/bin/bash
source ./holiday_0.56/bin/activate
python3 holidays-script.py
deactivate
source ./holiday_0.57/bin/activate
python3 holidays-script.py
deactivate

holidays-script.py:

import holidays
print("holidays version:", holidays.__version__)
bavaria = holidays.country_holidays('DE', subdiv='BY', years=2025)
for x in bavaria:
    print(x)

output:

holidays version: 0.56
2025-01-01
2025-04-18
2025-04-21
2025-05-01
2025-05-29
2025-06-09
2025-10-03
2025-12-25
2025-12-26
2025-01-06
2025-06-19
2025-08-15
2025-11-01
holidays version: 0.57
2025-01-01
2025-04-18
2025-04-21
2025-05-01
2025-05-29
2025-06-09
2025-10-03
2025-12-25
2025-12-26
2025-01-06
2025-06-19
2025-11-01

And indeed, in 0.57 the date 2025-08-15 is missing...

Guess i gonna create a new issue then on the library repo (https://github.com/vacanza/python-holidays)

Thank you for the help!

@gjohansson-ST
Copy link
Member

Thanks. Great investigation.
The related PR is here vacanza/python-holidays#1979 which removes those catholic dates in favor off using an optional category (will be implemented in workday later on).

There's also a "question" in the PR which might be worth "answering" in the issue you're creating.

@gjohansson-ST
Copy link
Member

Forgot that categories are indeed implemented so in the last option for categories if you select catholic it would include them (but since it seems you anyhow doesn't want them then you would not I guess).
Going to close the issue now as it's not related to the integration itself. Thanks 👍

@gjohansson-ST gjohansson-ST closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants