jaroschek / home-assistant-myuplink

Custom Home Assistant integration for devices and sensors in myUplink account.
39 stars 8 forks source link

Error while configuring the plugin #24

Closed Minka24 closed 9 months ago

Minka24 commented 9 months ago

After an update to the newest version of the integration HA was not able to load the integration after a restart.

So I decided to uninstall the myuplink HACS integration. While configuring the new instance the UI throws an error {"message":"Invalid handler specified"} and the logs showed an more detailed error as well:

ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration myuplink: cannot import name 'StrEnum' from 'enum' (/usr/local/lib/python3.10/enum.py)

Is there an issue with my HA instance or is the bug in the newest version of the integration?

jaroschek commented 9 months ago

This problem is cause, when you are not using python 3.10 for HA. I recently followed the recommendation to replace the backported StrEnum.

This was the advice that was given:

StrEnum is deprecated, We can now use the Python 3.11 provided enum.StrEnum insteadpylint(hass-deprecated-import)

But as I realize now, it can not be guaranteed that everybody switches to Python 3.11 instantly. So I will revert this change and restore the backported StrEnum.

jaroschek commented 9 months ago

@Minka24 The backported StrEnum is now restored and merged into main. When you update the integration it will work again.

Minka24 commented 9 months ago

Thanks for the very fast response. I’ll try later to update the integration.