You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting up a Workday sensor with no country, using all the default settings, the workday.check_date service incorrectly claims every day is a working day. The default settings exclude defined holidays, as well as Saturday and Sunday, so the date 2023-12-09 should return workday: false but it returns workday: true.
Only explicitly defined holidays, not other excluded days, are being considered by the workday.check_date service.
What version of Home Assistant Core has the issue?
core-2023.12.0
What was the last working version of Home Assistant Core?
N/A - set up a new Workday integration with no country and all default values.
Anything in the logs that might be useful for us?
N/A
Additional information
The service does correctly detect explicit holidays when defined, but since "Saturday" and "Sunday" are included in the exclusions list they also should indicate that the date is not a workday.
The text was updated successfully, but these errors were encountered:
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.
It does not work even if country is set. Looking at the code, it seems to only consider official holidays and not excluded days like saturday and sunday.
async def check_date(self, check_date: date) -> ServiceResponse: """Check if date is workday or not.""" holiday_date = check_date in self._obj_holidays return {"workday": not holiday_date}
The problem
When setting up a Workday sensor with no country, using all the default settings, the
workday.check_date
service incorrectly claims every day is a working day. The default settings exclude defined holidays, as well as Saturday and Sunday, so the date 2023-12-09 should returnworkday: false
but it returnsworkday: true
.Only explicitly defined holidays, not other excluded days, are being considered by the
workday.check_date
service.What version of Home Assistant Core has the issue?
core-2023.12.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
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
N/A - set up a new Workday integration with no country and all default values.
Anything in the logs that might be useful for us?
Additional information
The service does correctly detect explicit holidays when defined, but since "Saturday" and "Sunday" are included in the exclusions list they also should indicate that the date is not a workday.
The text was updated successfully, but these errors were encountered: