tjhowse / modbus4mqtt

Modbus TCP <-> MQTT glue. YAML configuration. Robust.
Other
81 stars 35 forks source link

Add support for more modbus connection variants #47

Closed M4GNV5 closed 1 year ago

M4GNV5 commented 1 year ago

My heatpump has a modbus Serial/RTU connector. Together with a transparent RS485<->TCP adapter I end up with modbus rtu-over-tcp. Previously this library only supported modbus TCP and sungrow variants. This pull request brings support for all the IP-based modbus variants available using pymodbus.

In the future the serial based variants could easily be added to modbus_interface, but I am not sure how to properly handle configuration for them.

codecov[bot] commented 1 year ago

Codecov Report

Merging #47 (b76cd40) into master (7f7a3f2) will increase coverage by 0.20%. The diff coverage is 97.36%.

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
+ Coverage   96.35%   96.56%   +0.20%     
==========================================
  Files           6        6              
  Lines        1015     1047      +32     
==========================================
+ Hits          978     1011      +33     
+ Misses         37       36       -1     
Files Changed Coverage Δ
modbus4mqtt/modbus_interface.py 96.73% <94.73%> (+1.01%) :arrow_up:
tests/test_modbus.py 98.04% <100.00%> (+1.51%) :arrow_up:

... and 1 file with indirect coverage changes

tjhowse commented 1 year ago

Thank you very much for this pull request! It has every feature of a great PR:

I really appreciate it. There's one minor readme fix required and then it's good to merge.