Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during setup of component Midea dehumidifier #35

Closed
phillipredshirt opened this issue Sep 2, 2021 · 2 comments · Fixed by #53
Closed

Error during setup of component Midea dehumidifier #35

phillipredshirt opened this issue Sep 2, 2021 · 2 comments · Fixed by #53

Comments

@phillipredshirt
Copy link

2021-09-02 16:33:47 ERROR (MainThread) [homeassistant.setup] Error during setup of component midea_dehumidifier
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 249, in _async_setup_component
result = await task
File "/config/custom_components/midea_dehumidifier/init.py", line 82, in async_setup
if a["onlineStatus"] == "1":
UnboundLocalError: local variable 'a' referenced before assignment

@ankostis
Copy link
Contributor

ankostis commented Jan 31, 2022

I guess there is some mistake in the indentation, all the lines below belong to the for-loop.
I will draft a PR.

Note that my v1.03 (Apr 2021) dumps a little different stack-trace:

Error during setup of component midea_dehumidifier

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 229, in _async_setup_component
    result = await task
  File "/config/custom_components/midea_dehumidifier/__init__.py", line 82, in async_setup
    if a["onlineStatus"] == "1":
UnboundLocalError: local variable 'a' referenced before assignment

ankostis added a commit to ankostis/homeassistant-midea-dehumidifier that referenced this issue Jan 31, 2022
Untested the fix here, but it works on my home's manually edited sources.
@ankostis
Copy link
Contributor

I guess the identation-error was not caught because the code kicks only when the appliance is offline.

barban-dev added a commit that referenced this issue Jan 5, 2024
fix #35: bad identation broke setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants