fustom / ariston-remotethermo-home-assistant-v3

Ariston NET remotethermo integration for Home Assistant based on API
MIT License
147 stars 37 forks source link

Rpi5 error #251

Closed Sz3cA closed 8 months ago

Sz3cA commented 8 months ago

Hello I have a problem with integration after changing from rpi3b+ to rpi5

IMG_4351

Source: setup.py:251
First occurred: 03:25:57 (1 occurrences)
Last logged: 03:25:57

Setup failed for custom integration 'ariston': Unable to import component: Exception importing custom_components.ariston
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 814, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/ariston/__init__.py", line 24, in <module>
    from .const import (
  File "/config/custom_components/ariston/const.py", line 67, in <module>
    class AristonBaseEntityDescription(EntityDescription, ABC):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 251, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 822, in get_component
    raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.ariston
Source: loader.py:814
First occurred: 03:25:57 (1 occurrences)
Last logged: 03:25:57

Unexpected exception importing component custom_components.ariston
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 814, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/ariston/__init__.py", line 24, in <module>
    from .const import (
  File "/config/custom_components/ariston/const.py", line 67, in <module>
    class AristonBaseEntityDescription(EntityDescription, ABC):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
fustom commented 8 months ago

https://developers.home-assistant.io/blog/2023/12/11/entity-description-changes

ZsBT commented 8 months ago

The metaclass issue is already fixed in the python-ariston-api github repo. However, linux distros still use the old code. My workaround was to overwrite the contents of /usr/local/lib/python3.11/site-packages/ariston in HA with the latest version. (HA beta on docker, rpi4 here)