Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add requirements pymodbus<=3.6.5 #658

Closed
wants to merge 1 commit into from
Closed

add requirements pymodbus<=3.6.5 #658

wants to merge 1 commit into from

Conversation

Zwer2k
Copy link

@Zwer2k Zwer2k commented Mar 18, 2024

Huawei_solar currently supports maxiamal pymodbus version 3.6.5. If another integration bump a newer version of pymodbus, then huawei_solar will no longer work. This has currently happened in connection with the integration homeassistant-solax-modbus.

@wlcrs
Copy link
Owner

wlcrs commented Mar 19, 2024

The underlying library already has the version pinned to <3.6: https://github.com/wlcrs/huawei-solar-lib/blob/399b839baf112733f868111a8069c8c8440869f0/setup.cfg#L22

The only real solution is to make sure that you don't use integrations with conflicting pymodbus requirements, as the integration that was installed the last will dictate what version of pymodbus is installed. 🙃

I'll look into upgrading the required pymodbus version for this integration instead

@wlcrs
Copy link
Owner

wlcrs commented Mar 19, 2024

Can you check if the problem is solved if you pin it to pymodbus>=3.6.6.

The issue that you are seeing seems to be fixed there by pymodbus-dev/pymodbus#2098

@Zwer2k
Copy link
Author

Zwer2k commented Mar 19, 2024

Then I get the error message again

2024-03-19 07:58:43.049 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'huawei_solar': Unable to import component: cannot import name 'checkCRC' from 'pymodbus.utilities' (/usr/local/lib/python3.12/site-packages/pymodbus/utilities.py) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 296, in _async_setup_component component = await integration.async_get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 894, in async_get_component comp = self.get_component() ^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 921, in get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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/huawei_solar/__init__.py", line 17, in <module> from huawei_solar import HuaweiSolarBridge, HuaweiSolarException, InvalidCredentials, register_values as rv File "/usr/local/lib/python3.12/site-packages/huawei_solar/__init__.py", line 6, in <module> from .bridge import HuaweiSolarBridge # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/huawei_solar/bridge.py", line 16, in <module> from .huawei_solar import DEFAULT_BAUDRATE, DEFAULT_SLAVE, DEFAULT_TCP_PORT, AsyncHuaweiSolar, Result File "/usr/local/lib/python3.12/site-packages/huawei_solar/huawei_solar.py", line 19, in <module> from pymodbus.utilities import checkCRC, computeCRC ImportError: cannot import name 'checkCRC' from 'pymodbus.utilities' (/usr/local/lib/python3.12/site-packages/pymodbus/utilities.py)

@wlcrs
Copy link
Owner

wlcrs commented Mar 19, 2024

Can you please try upgrading to v1.3.4 beta 1 ?

@Zwer2k
Copy link
Author

Zwer2k commented Mar 19, 2024

Everything seems to be working. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants