Rollback modbus to version 0.107.7 keep new functionality#34287
Rollback modbus to version 0.107.7 keep new functionality#34287MartinHjelmare merged 2 commits intohome-assistant:devfrom janiversen:modbus_issue6
Conversation
|
Hey there @adamchengtkc, mind taking a look at this pull request as its been labeled with a integration ( |
|
@vzahradnik could you take a look ? I am aware that many details could have been done better, but I have tried to strike a balance between reverting 100% to 0.107.7 and keep the new functionality. I like the bot, it added “new integration”, I did not change THAT much :-) |
|
@janiversen it looks good. As for my open PRs, I think it would be best not to merge them at this point. I will keep working with the async code, and maybe finally writing some unit tests. Please let me know if there's any progress with the Thanks! |
Update manifest to not use async. Rollback entities to sync version. Keep newer modifications apart from async. Rollback __init__ to sync version but keep the new functionality. add async sub directory Adding the current (not working) version in a sub directory, to allow easy sharing with a few alfa testers. The async version are to be updated to use the serial/tcp already available instead of the flaky pymodbus version. pymodbus is still needed to encode/decode the messagess. Update test cases to reflect sync implementation, but keep the new functionality like e.g. conftest.py.
|
@vzahradnik thanks for looking. I agree it is better to postpone merging of your PRs. I am not sure what is best to close them or put a big note in them. Once this PR is merged I will get started on getting the async version back to life, but with the use of non-io parts (basically framer) from pymodbus and io parts from hass. |
|
@janiversen I think it would be best to put a note in them and to keep them open. They are open for a while, and it does no harm in keeping it so. I will update them and put a reference to this PR. If maintainers decide to close them, I will create new ones when the code is ready again. |
|
Sounds like a good plan. Apart from the “async” and “await” both interfaces (test and runtime) are the same..the changes are internal. |
|
You can publish a branch on your github fork with the async changes if you need beta testers. I don't think we should add it here if that package is not used. |
The async version will be made available in a forked repo, until it is ready to replace the production code.
|
Removed async in for test and ha. |
|
Should we convert to draft until user tests are done, to protect from merging? |
|
That is a very good idea, thanks |
|
Converted all three. |
|
@MartinHjelmare thanks. Any idea when the next patch will be closed? (to get a timeframe for testing) |
|
Not sure. If there's enough PRs on a milestone we try to release asap. Last days before beta cut we often don't do patch releases since the beta is coming up anyway. |
|
How to test it? I have same problem but do not know how to test it.. when can I get changed file? |
|
I am not sure what you mean, the files are in this PR. You test it by modifying your system with these files. |
|
Tested in my system, works fine. Fixed #34269. |
|
Currently all seems fine.. But normaly it will take from 1 to 24 hours to stop working.. But currently is working with changed files.. |
|
I can also confirm that this PR seems to fix the previous problems with modbus serial failing when upgraded from 0.107.7 to any 0.108.x version. |
|
+1 Looks good from my end too. |
|
@MartinHjelmare We have enough positive test results. Can you please remove the “draft” for this PR so it can be merged, thanks in advance. |
|
I can confirm that changes made in PR is solution and is working. |
|
Hi, I upgrade HA to 0.108.6 from 0.108.5 and serial Modbus doesn't work. `` |
|
According to change notes, this fix/PR was not part of the 0.108.6 release. |
Breaking change
Proposed change
This PR does not solve the problems, but enables users to use modbus again, by reverting the change to async. It is basically an intelligent revert to version 0.107.7, meaning the new functionality is kept but we do not use pymodbus async.
Some of the testers have thankfully pinpointed (and reported) errors in the pymodbus asyncio implementation. It is not known when the reported bugs will be fixed, traditionally asyncio in pymodbus is not moving fast. In order to make the users happy, and revert is needed (this PR)
However the async version are to be updated to use the serial/tcp already
available instead of the flaky pymodbus version. pymodbus is still
needed to encode/decode the messages. In order to be able to share the new (not production) version with e.g. alfa testers a subdirectory have been added.
Having a subdirectory with new not production code, is not the standard way, but considering that this might take quite a time to solve, it seems to be the only way of not loosing the code and be able to work on it.
Of course test cases are also updated.
In order not to change documentation and/or configs already in place, the parameter “delay” is accepted with a warning that is currently is unused.
Before merging this change, it is important to get feedback from a couple of beta testers.
Once merged, please mark this PR to be included in the next patch release.
Type of change
Example entry for
configuration.yaml:# Example configuration.yamlAdditional information
fixes Modbus crash at startup 0.108.5 #34269, fixes Modbus #33872 does not work with Serial Devices #34046, fixes Device tracker - all devices become "Away" #34233, fixes Modbus rtuovertcp sends Modbus TCP packets instead on HA 0.108.2 #33947
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale: