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

Unable to edit Holiday options after selecting excluded Holidays #43

Closed
3 tasks done
oNSXo opened this issue Dec 26, 2022 · 0 comments
Closed
3 tasks done

Unable to edit Holiday options after selecting excluded Holidays #43

oNSXo opened this issue Dec 26, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@oNSXo
Copy link

oNSXo commented Dec 26, 2022

Before you submit a new bug report, please check that

Describe the bug

I configured a few holidays (including Washington's Birthday) to be excluded from the list. Now, when I try to reconfigure I get the KeyError and am unable to open that holiday exclusion list in config flow

Configuration

I have no idea why, but when I click "Download Diagnostics" on this device, no file is downloaded and the following error is logged.

2022-12-26 09:07:22.888 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, 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 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, 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 81, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/diagnostics/__init__.py", line 211, in get
    data = await info[d_type.value](hass, config_entry)
  File "/config/custom_components/holidays/diagnostics.py", line 18, in async_get_config_entry_diagnostics
    entity_data = [
  File "/config/custom_components/holidays/diagnostics.py", line 21, in <listcomp>
    if entities[entity].unique_id == entry.data["unique_id"]
KeyError: 'unique_id'

Debug logs

2022-12-26 08:56:25.279 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, 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 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, 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 81, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 241, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, 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 281, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/helpers/schema_config_entry_flow.py", line 390, in _async_step
    result = await self._common_handler.async_step(step_id, user_input)
  File "/usr/src/homeassistant/homeassistant/helpers/schema_config_entry_flow.py", line 129, in async_step
    return await self._async_form_step(step_id, user_input)
  File "/usr/src/homeassistant/homeassistant/helpers/schema_config_entry_flow.py", line 174, in _async_form_step
    return await self._show_next_step_or_create_entry(form_step)
  File "/usr/src/homeassistant/homeassistant/helpers/schema_config_entry_flow.py", line 184, in _show_next_step_or_create_entry
    next_step_id_or_end_flow = await form_step.next_step(self._options)
  File "/config/custom_components/holidays/config_flow.py", line 54, in choose_third_step
    del options[pop]
KeyError: "Washington's Birthday"
@oNSXo oNSXo added the bug Something isn't working label Dec 26, 2022
@bruxy70 bruxy70 closed this as completed Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants