homeassistant-midea-dehumidifier
                                
                                
                                
                                    homeassistant-midea-dehumidifier copied to clipboard
                            
                            
                            
                        Error during setup of component Midea dehumidifier
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
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
                                    
                                    
                                    
                                
I guess the identation-error was not caught because the code kicks only when the appliance is offline.