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 Integration fails in add_province_to_schema #92827

Closed
IanMajor12 opened this issue May 8, 2023 · 2 comments · Fixed by #92727
Closed

Workday Integration fails in add_province_to_schema #92827

IanMajor12 opened this issue May 8, 2023 · 2 comments · Fixed by #92727

Comments

@IanMajor12
Copy link

The problem

When adding Workday integration into HomeAssistant for Canada it fails with the message:

File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/workday/config_flow.py", line 56, in add_province_to_schema
if not obj_holidays.subdivisions:
AttributeError: 'Canada' object has no attribute 'subdivisions'

I looked around and no provinces for Canada, nor states for the United States.
The same error happens if I select AT as the country.

I'm trying to migrate from the configuration.yaml where I had a very simple configuration.

#binary_sensor:
#  - platform: workday
#    country: CA
#    province: "ON"
#    workdays: [mon, tue, wed, thu, fri]
#    excludes: [sat, sun, holiday]

What version of Home Assistant Core has the issue?

core-2023.5.2

What was the last working version of Home Assistant Core?

core-2023.4.x

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

None

Example YAML snippet

None

Anything in the logs that might be useful for us?

File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/workday/config_flow.py", line 56, in add_province_to_schema
    if not obj_holidays.subdivisions:
AttributeError: 'Canada' object has no attribute 'subdivisions'

Additional information

Note the USA and AT also failed, so I don't believe it's due to just Canada.

Maybe I need to clear out a cache?

@home-assistant
Copy link

home-assistant bot commented May 8, 2023

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.

(message by CodeOwnersMention)


workday documentation
workday source
(message by IssueLinks)

@maxistviews
Copy link

I am also having this issue. I also live in Canada and cannot set this up. Interestingly, even when trying to use other counties like the Netherlands, this issue still shows up.

Logger: aiohttp.server
Source: components/workday/config_flow.py:56
First occurred: 4:45:19 PM (1 occurrences)
Last logged: 4:45:19 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/workday/config_flow.py", line 187, in async_step_user
    return await self.async_step_options()
  File "/usr/src/homeassistant/homeassistant/components/workday/config_flow.py", line 233, in async_step_options
    schema = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/workday/config_flow.py", line 56, in add_province_to_schema
    if not obj_holidays.subdivisions:
AttributeError: 'CA' object has no attribute 'subdivisions'

@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants