dave-code-ruiz/uhomeuponor

KeyError: 'prefix'

Closed this issue · 3 comments

I've upgraded to the latest version, removed all old config lines in my yaml. I then add the integration, enter my IP and leave the optional "prefix" field empty I get an error:

2022-05-12 20:59:52 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/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 79, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 219, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 205, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 260, in async_configure
result = await self._async_handle_step(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 335, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/uhomeuponor/config_flow.py", line 32, in async_step_user
"prefix": user_input[CONF_PREFIX],
KeyError: 'prefix'

Ok, use some character as long as i solved it, or use versión 1.0.0

A space seems to work out great, causing no prefix. I guess whitespace gets stripped somewhere.

It works now, but there's one more step needed to be done that's not mentioned in the changelog/README. I got name conflicts with the old integration which caused all new entites to get an added number "xxx_02" which caused issues with existing dashboards. I had to delete the new integration, delete all old entities, readd the new integration and assign Area to the new entities. This way I got the same entity names and dashboard/scripts works.

Hit the wrong "Comment button" 🤦‍♂️