Closed Wilm0r closed 3 years ago
Having these unrelated changes bundled together makes this patch a little harder to review than I'd like.
We already basically have Python3 support - I'm running the code with Python3 routinely now. Your added b'' looks correct (we're probably just getting away with that because of the bytearray() around it.
The encode('ascii') seems an odd way to do things. Since the password we're giving to the inverter is essentially a bytestring, not an ascii string, it seems to me we should pass in a bytestring to cmd_logon() rather than encoding it there.
I like some of the small cleanups you've made in smabluetooth.py, but I'd prefer them as a separate commit.
I'm dubious about using the external CRC library. Re-using things is good as a rule, but this adds an external dependency which makes the code trickier to deploy, so I'm not sure its worth it for a pretty modest code saving.
Sadly there's no CRC library in Python by default, crcelk is an add-on library :-( But I like this more than including a reimplementation at least?