ganehag / pyMeterBus

Pure Python implementation of the Meter-Bus (M-Bus EN13757-3) protocol.
BSD 3-Clause "New" or "Revised" License
77 stars 40 forks source link

VIF(E): add support for enhancement extensions (M-Bus 8.4.5) #32

Closed cdu-genedis closed 3 months ago

cdu-genedis commented 3 months ago

Hello, Thanks in advance for considering this MR and extension to pyMeterBus. Best, Cédric

Unit tests OK
~/dev/upstream/pyMeterBus (HEAD -> VIFUnitEnhExt)
python -m unittest tests/test*.py
...........................................................................................................................INFO:meterbus.serial:RECV (001) 68
INFO:meterbus.serial:RECV (001) 03
INFO:meterbus.serial:RECV (001) 03
INFO:meterbus.serial:RECV (001) 68
INFO:meterbus.serial:RECV (001) 08
INFO:meterbus.serial:RECV (001) 0B
INFO:meterbus.serial:RECV (001) 72
INFO:meterbus.serial:RECV (001) 00
INFO:meterbus.serial:RECV (001) 16
.INFO:meterbus.serial:SEND (005) 10 40 00 40 16
.INFO:meterbus.serial:SEND (005) 10 5B 00 5B 16
....INFO:meterbus.serial:SEND (005) 10 7B 00 7B 16
INFO:meterbus.serial:SEND (005) 10 5B 00 5B 16
.INFO:meterbus.serial:SEND (005) 10 40 00 40 16
INFO:meterbus.serial:RECV (001) E5
.INFO:meterbus.serial:RECV (001) 68
INFO:meterbus.serial:RECV (001) 53
INFO:meterbus.serial:RECV (001) 53
INFO:meterbus.serial:RECV (001) 68
INFO:meterbus.serial:RECV (001) 08
INFO:meterbus.serial:RECV (001) 05
INFO:meterbus.serial:RECV (001) 72
INFO:meterbus.serial:RECV (001) 34
INFO:meterbus.serial:RECV (001) 08
.INFO:meterbus.serial:SEND (005) 10 5B 00 5B 16
.INFO:meterbus.serial:SEND (017) 68 0B 0B 68 73 FD 52 01 00 00 00 DA DA FA 1B 8C 16
INFO:meterbus.serial:RECV (001) E5
.INFO:meterbus.serial:SEND (005) 10 5B 00 5B 16
....................................................................................
----------------------------------------------------------------------
Ran 218 tests in 0.346s

OK

~/dev/upstream/pyMeterBus (HEAD -> VIFUnitEnhExt, genedis/VIFUnitEnhExt)
python -m unittest -v tests/test_variable_data_record.py
test_datafield_set (tests.test_variable_data_record.TestSequenceFunctions.test_datafield_set) ... ok
test_json_record0 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record0) ... ok
test_json_record1 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record1) ... ok
test_json_record10 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record10) ... ok
test_json_record11 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record11) ... ok
test_json_record12 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record12) ... ok
test_json_record13 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record13) ... ok
test_json_record2 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record2) ... ok
test_json_record4 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record4) ... ok
test_json_record5 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record5) ... ok
test_json_record6 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record6) ... ok
test_json_record7 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record7) ... ok
test_json_record8 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record8) ... ok
test_json_record9 (tests.test_variable_data_record.TestSequenceFunctions.test_json_record9) ... ok
test_json_value_str (tests.test_variable_data_record.TestSequenceFunctions.test_json_value_str) ... ok
test_more_records_follow_false (tests.test_variable_data_record.TestSequenceFunctions.test_more_records_follow_false) ... ok
test_more_records_follow_true (tests.test_variable_data_record.TestSequenceFunctions.test_more_records_follow_true) ... ok
test_parsed_value_invalid_data_len (tests.test_variable_data_record.TestSequenceFunctions.test_parsed_value_invalid_data_len) ... ok
test_verify_float_value (tests.test_variable_data_record.TestSequenceFunctions.test_verify_float_value) ... ok
test_verify_function (tests.test_variable_data_record.TestSequenceFunctions.test_verify_function) ... ok
test_verify_str_value (tests.test_variable_data_record.TestSequenceFunctions.test_verify_str_value) ... ok
test_verify_ustr_value (tests.test_variable_data_record.TestSequenceFunctions.test_verify_ustr_value) ... ok
test_vif_mult_oxfc_0x78 (tests.test_variable_data_record.TestSequenceFunctions.test_vif_mult_oxfc_0x78) ... ok
test_vif_mult_oxfc_0x7B (tests.test_variable_data_record.TestSequenceFunctions.test_vif_mult_oxfc_0x7B) ... ok
test_vif_mult_oxfc_0x7D (tests.test_variable_data_record.TestSequenceFunctions.test_vif_mult_oxfc_0x7D) ... ok

----------------------------------------------------------------------
Ran 25 tests in 0.014s

OK
ganehag commented 3 months ago

Sweet. Thanks Cédric!