bang-olufsen / bang_olufsen-hacs

Home Assistant integration for Bang & Olufsen products. Compatible devices: Beoconnect Core, Beolab 8, Beolab 28, Beosound 2 3rd gen, Beosound A5, Beosound A9 5th gen, Beosound Balance, Beosound Emerge, Beosound Level and Beosound Theatre
MIT License
30 stars 3 forks source link

Integration fails to set up in 1.5.3 #8

Closed spacecakes closed 1 year ago

spacecakes commented 1 year ago

The integration fails to start after updating from 1.3.x to latest. Does this log tell you anything? I use this every day so hopefully we can sort it out :)

2023-10-05 12:27:54.000 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration bangolufsen which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-10-05 12:30:20.059 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration bangolufsen: Unable to import component: cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)
  File "/config/custom_components/bangolufsen/__init__.py", line 26, in <module>
  File "/config/custom_components/bangolufsen/binary_sensor.py", line 16, in <module>
    from .entity import BangOlufsenEntity
  File "/config/custom_components/bangolufsen/entity.py", line 7, in <module>
2023-10-05 12:31:54.843 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration bangolufsen: cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)
2023-10-05 12:31:54.847 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration bangolufsen: cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)
  File "/config/custom_components/bangolufsen/__init__.py", line 26, in <module>
  File "/config/custom_components/bangolufsen/binary_sensor.py", line 16, in <module>
    from .entity import BangOlufsenEntity
  File "/config/custom_components/bangolufsen/entity.py", line 7, in <module>
2023-10-05 13:21:17.691 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration bangolufsen which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

Then when I try to set it up again from scratch:

Config flow could not be loaded: {"message":"Invalid handler specified"}

spacecakes commented 1 year ago

Found a workaround. Downgrading to 1.3 and manually deleting all bang_olufsen entries from ./storage/core.config_entries in the HA dir seems to have fixed it and allowed me to set up the extension again.

mj23000 commented 1 year ago

Thank you for the bug report. Are you using and older release of Home Assistant? It looks like you are using a Home Assistant Core version older or equal to 2023.8, which is not compatible with the bangolufsen integration version 1.4 and above, since DeviceInfo is now located in homeassistant.helpers.device_registry and not homeassistant.helpers.entity. Nevertheless, the required Home Assistant version has now been updated to 2023.8 in release 1.5.4.

spacecakes commented 1 year ago

You know what, I'm confused. I experienced issues with this integration when I updated HA to latest the other day, and since I absolutely depend on it I decided to downgrade HA until I could find a solution. That didn't help however so I downgraded the integration too and finally got it working.

I'm now on HA 2013.10 and just installed bangolufsen-hacs 1.5.4 and everything works well, so I'm not sure exactly what went on. Might have been a perfect storm of unrelated issues. Anyway, works again! Sorry to waste your time, but thanks for this integration. It's so good.