yozik04 / nibe

Library for communication with Nibe heatpumps.
GNU General Public License v3.0
46 stars 33 forks source link

Rewrite modbus decode/encode to avoid relying on nibegw based formats #128

Closed elupus closed 10 months ago

elupus commented 11 months ago

Handle the case of signed 8 bit values for modbus by avoiding using the NibeGw based parsing of data. Instead create a new coder for modbus based data.

Fixes: #125

elupus commented 11 months ago

Likely need to add some additional tests for this. But does this make sense?

codecov[bot] commented 11 months ago

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (95f968e) 57.43% compared to head (25d52a6) 58.22%. Report is 16 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #128 +/- ## ========================================== + Coverage 57.43% 58.22% +0.79% ========================================== Files 14 14 Lines 1177 1197 +20 ========================================== + Hits 676 697 +21 + Misses 501 500 -1 ``` | [Files](https://app.codecov.io/gh/yozik04/nibe/pull/128?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jevgeni+Kiski) | Coverage Δ | | |---|---|---| | [nibe/coil.py](https://app.codecov.io/gh/yozik04/nibe/pull/128?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jevgeni+Kiski#diff-bmliZS9jb2lsLnB5) | `91.85% <100.00%> (+0.12%)` | :arrow_up: | | [nibe/connection/modbus.py](https://app.codecov.io/gh/yozik04/nibe/pull/128?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jevgeni+Kiski#diff-bmliZS9jb25uZWN0aW9uL21vZGJ1cy5weQ==) | `83.95% <100.00%> (+4.56%)` | :arrow_up: | | [nibe/connection/nibegw.py](https://app.codecov.io/gh/yozik04/nibe/pull/128?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jevgeni+Kiski#diff-bmliZS9jb25uZWN0aW9uL25pYmVndy5weQ==) | `63.85% <100.00%> (ø)` | | | [nibe/connection/encoders.py](https://app.codecov.io/gh/yozik04/nibe/pull/128?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jevgeni+Kiski#diff-bmliZS9jb25uZWN0aW9uL2VuY29kZXJzLnB5) | `93.97% <93.33%> (-4.07%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/yozik04/nibe/pull/128/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jevgeni+Kiski)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

yozik04 commented 11 months ago

Fully makes sense. Finish it and I will merge.

yozik04 commented 10 months ago

Is this PR still draft? I think it can be merged.

elupus commented 10 months ago

Merged it. Can you create a new release so can get that into next release of HA (still some days off so no huge rush)

yozik04 commented 10 months ago

Released in 2.5.0