dotKrad / hass-fpl

FPL Component for Home Assistant
MIT License
40 stars 20 forks source link

Recent Update edff06c Broke Add Integration Config Flow #11

Closed adam-olson closed 3 years ago

adam-olson commented 3 years ago

Version of the custom_component

edff06c

Configuration

image


Add your logs here.

Describe the bug

After most recent update when trying to add integration into Home Assistant, receive an error "Config Flow could not be loaded"

Debug log

2021-06-05 21:15:29 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/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 76, 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 135, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 128, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 72, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 153, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 179, 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 260, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/fpl/config_flow.py", line 81, in async_step_user
    return await self._show_config_form(user_input)
  File "/config/custom_components/fpl/config_flow.py", line 93, in _show_config_form
    data_schema[vol.Required(CONF_USERNAME, default=username)] = str
UnboundLocalError: local variable 'username' referenced before assignment
dotKrad commented 3 years ago

let me check it

On Sat, Jun 5, 2021 at 9:20 PM adam-olson @.***> wrote:

Version of the custom_component

edff06c https://github.com/dotKrad/hass-fpl/commit/edff06c22dd97e8c2fe8ff6350d3086aab28cb98 Configuration

[image: image] https://user-images.githubusercontent.com/45909856/120909484-9cc1ff00-c643-11eb-8e74-15cc7d8e1986.png

Add your logs here.

Describe the bug

After most recent update when trying to add integration into Home Assistant, receive an error "Config Flow could not be loaded" Debug log

2021-06-05 21:15:29 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request resp = await self._request_handler(request) File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle resp = await handler(request) File "/usr/local/lib/python3.8/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 76, 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 135, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 128, in post return await super().post(request) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 72, in post result = await self._flow_mgr.async_init( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 153, in async_init flow, result = await task File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 179, 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 260, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/fpl/config_flow.py", line 81, in async_step_user return await self._show_config_form(user_input) File "/config/custom_components/fpl/config_flow.py", line 93, in _show_config_form data_schema[vol.Required(CONF_USERNAME, default=username)] = str UnboundLocalError: local variable 'username' referenced before assignment

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dotKrad/hass-fpl/issues/11, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6TTAQUEBTMJDS6HQHDA5LTRLEORANCNFSM46FH5M2A .

dotKrad commented 3 years ago

can you try now ?

adam-olson commented 3 years ago

New update seems to have corrected issue, was able to add the integration and see account info pulled in.