pwitab / iec62056-21

A Python library for IEC62056-21, Local Data Readout of Energy Meters. Former IEC1107
BSD 3-Clause "New" or "Revised" License
65 stars 18 forks source link

Add initial support for protocol mode B #21

Open emontnemery opened 2 years ago

emontnemery commented 2 years ago

This adds basic support for mode B:

Accessing of programming mode is not implemented

Krolken commented 2 years ago

Thanks for starting support for Mode B.

But I would prefer a separate Client object over a mode selection arg.

So to have ModeCClient and ModeBClient

I think that would keep the code more maintainable and fixes for one type of meter would give less risk of breaking stuff for others.

Once A, D and E mode are implemented the code would othewise be filled with tons of if-statements making it hard to understand.

emontnemery commented 2 years ago

OK, that sounds good! Just to confirm, you mean refactoring by splitting out the specifics for each mode to subclasses of Iec6205621Client, which will then be an abstract class?

Krolken commented 2 years ago

I started a discussion about it for better collaboration. #22