keshavdv / victron-ble

A Python API to parse Victron Instant Readout BLE advertisements
The Unlicense
103 stars 34 forks source link

Inconsistency in where data transforms occur #24

Open stefanor opened 1 year ago

stefanor commented 1 year ago

I was looking at adding proper support for all the NA values (from #17), but quickly got stuck, because we're inconsistent in where we transform data. Some is done in the parse function, and some in the Data class.

It would make sense to do it all in one place, so that we can check for special flag values there.

stefanor commented 1 year ago

It probably makes sense to just keep the bit-level unpacking in parse and move all the unit-conversion to the Data class.

j9brown commented 9 months ago

I kept stumbling over bugs in the parsing logic so I rewrote it here: https://github.com/j9brown/victron-ble/commit/43c172ab51e965dce2f75a38649298c46c0bf7ff