KeyError: 'site_name' - Can't configure component when site has no name specified
See original GitHub issueVersion of the custom_component
1.1.0
Configuration
Describe the bug
When attempting to configure the integration it fails with this (and yes I put the correct token in the window):
I only have a solar system (no car), I think it’s related to this: https://github.com/alandtse/tesla/pull/58. Maybe @giachello knows what’s going on?
Debug log
2021-10-12 11:34:20 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 422, in _handle_request
resp = await self._request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, 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 220, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, 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 157, 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 111, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 198, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 256, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/tesla_custom/config_flow.py", line 56, in async_step_user
info = await validate_input(self.hass, user_input)
File "/config/custom_components/tesla_custom/config_flow.py", line 160, in validate_input
result = await controller.connect(test_login=True)
File "/usr/local/lib/python3.9/site-packages/teslajsonpy/controller.py", line 349, in connect
self.__energysite_name[energysite_id] = energysite["site_name"]
KeyError: 'site_name'
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
KeyError: 'Name' , What's the issue? - python - Stack Overflow
This code works fine for me except that you don't have item defined? Assuming that item is some sort of container like (Name,...
Read more >Troubleshooting — JupyterHub 3.1.0 documentation
The JupyterHub logs have jupyterhub KeyError: "getpwnam(): name not found: <my_user_name> . This issue occurs when the authenticator requires a local system ...
Read more >Configuring Django Settings: Best Practices
This article is intended for engineers who use the Django framework. It gives a deep insight into configuring Django project settings, ...
Read more >Request and response objects - Django documentation
When a page is requested, Django creates an HttpRequest object that contains metadata about the request. Then Django loads the appropriate view, ...
Read more >Changelog — Python 3.11.1 documentation
gh-94526: Fix the Python path configuration used to initialized sys.path at Python startup. Paths are no longer encoded to UTF-8/strict to avoid ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It works perfectly, thanks!
Just wanted to add a comment:
Once the name is changed, this error disappears in the integration.