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 support for pymodbus 3.x.x #39

Merged
merged 1 commit into from
Jan 24, 2024
Merged

Add support for pymodbus 3.x.x #39

merged 1 commit into from
Jan 24, 2024

Conversation

eode
Copy link
Contributor

@eode eode commented Nov 9, 2023

This is an implementation of the changes mentioned in #35, plus the removal of the from pymodbus.compat import iteritems line, as pymodbus.compat doesn't exist in version 3, and the line was unused anyways.

Summary of changes for classic_mqtt.py:

  • Catch import error if pymodbus 3 doesn't load, and try pymodbus 2

Summary of changes for support/classic_modbusdecoder.py:

  • Catch import error if pymodbus 3 doesn't load, and try pymodbus 2
  • Flag what pymodbus version we're using
  • use slave= for version 3 and unit= for version 2.

I could also just drop support for pymodbus 2, but it seems pretty easy and straightforward to keep it.

@eode
Copy link
Contributor Author

eode commented Jan 24, 2024

ping?

@graham22 graham22 merged commit 046bd18 into ClassicDIY:master Jan 24, 2024
@eode
Copy link
Contributor Author

eode commented Jan 24, 2024

Thanks.

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