Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

UnboundLocalError because of previous exception #213

Closed
sbidy opened this issue Dec 16, 2021 · 1 comment
Closed

UnboundLocalError because of previous exception #213

sbidy opened this issue Dec 16, 2021 · 1 comment
Assignees
Labels
Bug Something isn't working fixed but in review

Comments

@sbidy
Copy link
Owner

sbidy commented Dec 16, 2021

await self.async_set_unique_id(mac)

If bulb is not reachable at setup.

homeassistant    | 2021-12-16 21:29:28 ERROR (MainThread) [aiohttp.server] Error handling request
homeassistant    | Traceback (most recent call last):
homeassistant    |   File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
homeassistant    |     resp = await request_handler(request)
homeassistant    |   File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
homeassistant    |     resp = await handler(request)
homeassistant    |   File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 220, in forwarded_middleware
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 181, in auth_middleware
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
homeassistant    |     result = await result
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 157, in post
homeassistant    |     return await super().post(request, flow_id)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
homeassistant    |     result = await method(view, request, *args, **kwargs)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
homeassistant    |     result = await self._flow_mgr.async_configure(flow_id, data)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 252, in async_configure
homeassistant    |     result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
homeassistant    |     result: FlowResult = await getattr(flow, method)(user_input)
homeassistant    |   File "/config/custom_components/wiz_light/config_flow.py", line 47, in async_step_user
homeassistant    |     await self.async_set_unique_id(mac)
homeassistant    | UnboundLocalError: local variable 'mac' referenced before assignment
@sbidy sbidy self-assigned this Dec 16, 2021
@sbidy sbidy added Bug Something isn't working fixed but in review labels Dec 16, 2021
@bdraco
Copy link

bdraco commented Feb 15, 2022

This can be closed as its confirmed fixed in the core version

@sbidy sbidy closed this as completed Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working fixed but in review
Projects
None yet
Development

No branches or pull requests

2 participants