homeassistant-midea-dehumidifier icon indicating copy to clipboard operation
homeassistant-midea-dehumidifier copied to clipboard

Error during setup of component Midea dehumidifier

Open phillipredshirt opened this issue 4 years ago • 2 comments

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

phillipredshirt avatar Sep 02 '21 21:09 phillipredshirt

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 avatar Jan 31 '22 20:01 ankostis

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

ankostis avatar Jan 31 '22 20:01 ankostis