Add custom data type support into Modbus climate#32439
Add custom data type support into Modbus climate#32439MartinHjelmare merged 6 commits intohome-assistant:devfrom Lutemi:feature/modbus-climate-custom-data-type
Conversation
|
Hey there @adamchengtkc, mind taking a look at this pull request as its been labeled with a integration ( |
|
@springstan thanks for the comments. I will postpone my work until PR #32557 gets merged. It refactored most of the Modbus integration, and my code will need to be adapted for that. |
|
I think that is a good idea. Be aware I am working on changing the tests, so that there a common part (basically run_test) and each entity only contains the actual test |
|
@janiversen yeah, I saw your comments in that other PR. Thanks for the heads up. |
janiversen
left a comment
There was a problem hiding this comment.
This PR needs to be updated to our new standard. Once updated I will make a more in depth review, but in general it looks good.
|
The reworked test harness is now merged, so no excuses for not writing test cases :-) |
|
@janiversen, I rebased the code against latest |
janiversen
left a comment
There was a problem hiding this comment.
I had hoped you would have added just a couple of tests. We need that to get a higher (than no-score) on our integration.
My question about >f is just a question, not a request that you do it differently.
|
Regarding the pytest error, pull newest dev and rebase then it is gone. |
|
@janiversen just today I checked the integration quality scale requirements. If they're still up to date (and they should be), we meet almost all requirements to get the silver rating. Unit tests are not a requirement there. What we don't meet is following:
If we manage to fix the logging, this integration could be certified. At the moment, And regarding the tests, I didn't have time this week. I'm glad that I found some time to go through all my pull requests. |
janiversen
left a comment
There was a problem hiding this comment.
Reviewed this version of the code, and it is ready (from my side) to be merged.
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
Still working on it. |
|
@janiversen please check this PR. Rebased against latest dev and re-tested. |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
Still working on it. |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
This PR is still pending review from maintainers. I can, however, rebase the change to find out it still works with latest Home Assistant code. |
|
??? as one of the code owners and maintainer I approved the code 13 of April. You have a number of good Prs which should have been merged for a long time, I hope we can soon get it done. Let me know if I can do anything? |
|
@MartinHjelmare sorry, I missed that comment. Yes, I also want my PRs to get merged. Just I don't have a time to work on them at this moment. I plan to review all of them when I finally get some free time. Thanks, I will let you know if there's anything. |
|
Any idea when you will continue working on this PR. We have a issue open on climate, but I do not want to make your work more difficult by adding a new PR for the same code. |
@janiversen it looks like I'll need to rework the way how the Climate component is configured. If you want to work on the issue, go ahead. I will deal with your changes, and adapt my code accordingly. |
|
OK, I will continue first by adding a couple of simple tests (I am in the process of adding tests for all devices), and then solve the bug, which I think is easy. I will comment on the other PR regarding the config changes. |
|
@janiversen OK, thanks! Today I also reworked how config for the |
janiversen
left a comment
There was a problem hiding this comment.
I am happy with the code, it looks good. But I would really like to see the sensor test cases expanded.
I will take a look at it. |
|
Please add a before and after example view of the configuration yaml section to the breaking changes paragraph. |
Done. |
|
The failing test is not your problem. Simply push again (e.g. with an updated commit text) |
This commit adds support for custom data type and improves error handling. Currently, if a user set data_count into a value other than 1, 2 or 4 bytes, code threw an exception because it didn't support the parsing. New behavior is to notify user that parsing was not successful, and to inform him to specify custom data structure to use. This behavior will be the same as used in Modbus sensor. Fix linter warnings
Home Assistant requires this method; however, because our Climate component doesn't support other modes than AUTO, we'll keep the method body empty. The only purpose is to avoid getting NotImplementedError due to this.
|
The checks were failing on the linter error - unnecessary Thanks! |
|
Interesting it worked fine in my environment (test), but super that you found it, and I see that @MartinHjelmare have approved the PR, so lets hope it gets merged soon. |
It was a linter issue - |
Breaking change
Climate configuration was moved from the platform directly into the
Modbusintegration. This change was required to meet thelatest architecture requirements for Home Assistant.
Before
After
Proposed change
This commit adds support for custom data type into Modbus climate,
and improves error handling.
Currently if a user sets
data_countinto a value other than 1, 2 or 4 bytes,code throws an exception because it didn't support the parsing.
New behavior is to notify user that parsing was not successful,
and to inform him to specify a custom data structure to use.
This behavior will be the same as used in Modbus sensor.
Type of change
Example entry for
configuration.yaml:Additional information
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: