KoljaWindeler / ics

Integration that displays the next event of an ics link (support reoccuring events)
51 stars 12 forks source link

ConfigFlow Error #9

Closed ghost closed 4 years ago

ghost commented 4 years ago

I'm running Home-Assistant Core 0.108.8 in Docker (Image) and installed version c25af36 of ics via HACS 0.24.2.

As per the installation instructions I restarted HA after installing. I then went to Configuration > Integrations > "+" Button > ICS. After clicking on ICS it briefly shows a loading window and then puts me back to the "Set up a new integration" window. Under Developer Tools > Logs the following entry can be seen:

Log Details (ERROR)

Logger: aiohttp.server Source: helpers/entity.py:78 First occurred: 5:14:11 PM (2 occurrences) Last logged: 5:16:20 PM

Error handling request

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
resp = await task
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 123, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 130, in post
return await super().post(request)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 50, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 62, in post
handler, context={"source": config_entries.SOURCE_USER}
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 109, in async_init
result = await self._async_handle_step(flow, flow.init_step, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 172, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "/config/custom_components/ics/config_flow.py", line 38, in async_step_user
return self.async_show_form(step_id="user", data_schema=vol.Schema(create_form(user_input)), errors=self._errors)
File "/config/custom_components/ics/const.py", line 95, in create_form
id = get_next_id()
File "/config/custom_components/ics/const.py", line 78, in get_next_id
if(async_generate_entity_id(ENTITY_ID_FORMAT, "ics_" + str(i), hass=get_hass()) == PLATFORM+".ics_" + str(i)):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 78, in async_generate_entity_id
raise ValueError("Missing required parameter currentids or hass")
ValueError: Missing required parameter currentids or hass

Please let me know if I did something wrong or if you need any other information from me. If you want me to test something on my setup I would be happy to help.

KoljaWindeler commented 4 years ago

Hi, could you try with the version that I've just uploaded? I've changed quite a few thing in the integration flow lately. Thanks Kolja

ghost commented 4 years ago

Updated ics to ca159d4. All other versions remain the same.

Sadly the same issue as before:

Log Details (ERROR)

Logger: aiohttp.server Source: helpers/entity.py:78 First occurred: 6:57:26 PM (1 occurrences) Last logged: 6:57:26 PM

Error handling request

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
resp = await task
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 123, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 130, in post
return await super().post(request)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 50, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 62, in post
handler, context={"source": config_entries.SOURCE_USER}
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 109, in async_init
result = await self._async_handle_step(flow, flow.init_step, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 172, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "/config/custom_components/ics/config_flow.py", line 38, in async_step_user
return self.async_show_form(step_id="user", data_schema=vol.Schema(create_form(1, user_input)), errors=self._errors)
File "/config/custom_components/ics/const.py", line 200, in create_form
user_input = ensure_config(user_input)
File "/config/custom_components/ics/const.py", line 112, in ensure_config
out[CONF_ID] = get_next_id()
File "/config/custom_components/ics/const.py", line 93, in get_next_id
if(async_generate_entity_id(ENTITY_ID_FORMAT, "ics_" + str(i), hass=get_hass()) == PLATFORM+".ics_" + str(i)):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 78, in async_generate_entity_id
raise ValueError("Missing required parameter currentids or hass")
ValueError: Missing required parameter currentids or hass
KoljaWindeler commented 4 years ago

hmm that is strange, could you check the updated files. that will not fix the problem, but work around it. kolja

ghost commented 4 years ago

Updated ics to 7dbc2c5.

Good news the config flow showed up and I was able to get it to create a functioning entity. Interestingly the second config dialog had no labels and I was not able to guess which option does what (Screenshot). But that might be a different issue.

Thank you very much for your fast help so far.

KoljaWindeler commented 4 years ago

could you try once more? I think I found a safe way .. it should now suggest a id (e.g. 2 if you already have once configured) and the label should also be in place. Kolja

ghost commented 4 years ago

Updated ics to 58a59fb.

The id suggestion and the second config page worked perfectly.

Thanks so much for your help. If you don't want me to test anything else feel free to close this issue.

KoljaWindeler commented 4 years ago

I'll get back at this offer once I have a new killer feature (skip events are currently only tested by me - but that's not that important I think) Kolja