Tasshack/dreame-vacuum

Integration not getting loaded after upgrading to 2024.10.0

kaizersoje opened this issue · 5 comments

Describe the bug
A clear and concise description of what the bug is.
The integration not getting loaded after upgrading to 2024.10.0

To Reproduce
Steps to reproduce the behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional Information (please complete the following information)

  • Model Name [e.g. dreame.vacuum.p2028]:
  • Firmware Version [e.g. 1156]:
  • Home Assistant Version:
  • Configuration Type [With or without map support]:
  • Errors or warnings shown in the HA logs (if applicable):
Logger: homeassistant.setup
Source: setup.py:334
First occurred: 06:46:56 (1 occurrences)
Last logged: 06:46:56

Setup failed for custom integration 'dreame_vacuum': Unable to import component: cannot import name 'MiniRacer' from 'py_mini_racer' (/usr/local/lib/python3.12/site-packages/py_mini_racer/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1007, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/dreame_vacuum/__init__.py", line 7, in <module>
    from .coordinator import DreameVacuumDataUpdateCoordinator
  File "/config/custom_components/dreame_vacuum/coordinator.py", line 20, in <module>
    from .dreame import DreameVacuumDevice, DreameVacuumProperty
  File "/config/custom_components/dreame_vacuum/dreame/__init__.py", line 29, in <module>
    from .device import DreameVacuumDevice
  File "/config/custom_components/dreame_vacuum/dreame/device.py", line 108, in <module>
    from .map import DreameMapVacuumMapManager
  File "/config/custom_components/dreame_vacuum/dreame/map.py", line 14, in <module>
    from py_mini_racer import MiniRacer
ImportError: cannot import name 'MiniRacer' from 'py_mini_racer' (/usr/local/lib/python3.12/site-packages/py_mini_racer/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component
    self._component_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1019, in async_get_component
    comp = self._get_component()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/dreame_vacuum/__init__.py", line 7, in <module>
    from .coordinator import DreameVacuumDataUpdateCoordinator
  File "/config/custom_components/dreame_vacuum/coordinator.py", line 20, in <module>
    from .dreame import DreameVacuumDevice, DreameVacuumProperty
  File "/config/custom_components/dreame_vacuum/dreame/__init__.py", line 29, in <module>
    from .device import DreameVacuumDevice
  File "/config/custom_components/dreame_vacuum/dreame/device.py", line 108, in <module>
    from .map import DreameMapVacuumMapManager
  File "/config/custom_components/dreame_vacuum/dreame/map.py", line 14, in <module>
    from py_mini_racer import MiniRacer
ImportError: cannot import name 'MiniRacer' from 'py_mini_racer' (/usr/local/lib/python3.12/site-packages/py_mini_racer/__init__.py)

Your HA did not install one of the required dependency, that is why it is not working.
https://github.com/Tasshack/dreame-vacuum/blob/master/custom_components/dreame_vacuum/manifest.json#L18

Try removing the integration and adding it again or install the package manually yourself.

Hi @Tasshack how do I install it myself? Any idea why HA did not installe the dependency? It was working previously.

There is no way to know why it is not installed without the update logs.

I need to know your HA installation type for manual install.

I have HA OS installed on a RPi4

You need to run this command from ssh but pip may not be available for the HA OS, i have never used it before.

sudo pip install py-mini-racer