bruxy70 / Garbage-Collection

🗑 Custom Home Assistant sensor for scheduling garbage collection (or other regularly re-occurring events - weekly on given days, semi-weekly or monthly)
MIT License
383 stars 90 forks source link

Issues adding helper via UI #441

Closed grantclem closed 1 year ago

grantclem commented 1 year ago

Before you submit a new bug report, please check that

Describe the bug

Using latest beta - 2022.12.0b0 , not sure if this is related.

Error adding helper:

image

Log error:

2022-12-01 19:07:52.027 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 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 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 222, 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 148, in post
    return await super().post(request)
  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 71, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 226, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 253, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  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 305, 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 176, in _async_form_step
    return await self._show_next_step(step_id)
  File "/usr/src/homeassistant/homeassistant/helpers/schema_config_entry_flow.py", line 209, in _show_next_step
    if (data_schema := await self._get_schema(form_step)) is None:
  File "/usr/src/homeassistant/homeassistant/helpers/schema_config_entry_flow.py", line 137, in _get_schema
    return await form_step.schema(self)
TypeError: general_config_schema() missing 1 required positional argument: 'options'

Configuration

N/A

Debug logs

2022-12-01 19:07:52.027 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 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 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 222, 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 148, in post
    return await super().post(request)
  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 71, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 226, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 253, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  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 305, 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 176, in _async_form_step
    return await self._show_next_step(step_id)
  File "/usr/src/homeassistant/homeassistant/helpers/schema_config_entry_flow.py", line 209, in _show_next_step
    if (data_schema := await self._get_schema(form_step)) is None:
  File "/usr/src/homeassistant/homeassistant/helpers/schema_config_entry_flow.py", line 137, in _get_schema
    return await form_step.schema(self)
TypeError: general_config_schema() missing 1 required positional argument: 'options'
bruxy70 commented 1 year ago

Confirmed. I get that in the beta as well. Will figure out what has changed. Thanks. The existing entities work, but I am unable to configure them and create new ones.

bruxy70 commented 1 year ago

Still haven't found the issue. I do not see any reference to the custom integration code. Tried to trace it, and it failed before it gets to the config flow. Probably something changed in the data definition. Will ask for help on Discord.

bruxy70 commented 1 year ago

Ok, Discord did not help, but I think I've found the issue. This thing has rather complicate configuration - probably most complicated from what I have seen so far. In the second step, it dynamically builds the form based on the choices in the first step, and for that reason, I call the configuration step with a parameter referring to the options. It looks like they have streamlined the configuration so that is not possible anymore, at least not easily. I am trying to patch it, but so far, no success. So it is unlikely this will be fixed before the release.

grantclem commented 1 year ago

I am sure you have better things to do? Thanks for your effort trying to resolve this.

bruxy70 commented 1 year ago

Would you like to try the beta release 4.10.0b1? Thanks!

tykeal commented 1 year ago

I just upgraded to 2022.12 and am running into this. I did just try 4.10.0b1 and it's still having the same issue

tykeal commented 1 year ago

Scratch that, I thought I had updated to 4.10.0b1 but I noticed after my restart that HACS was still saying I had an update pending. That seems to have fixed the problem for me.

grantclem commented 1 year ago

Working great, thanks for your effort resolving this.