alengwenus / pypck

Asynchronous LCN-PCK library written in Python
MIT License
8 stars 4 forks source link

Fix VarUnit issues and add tests for conversion roundtrip and calibration #83

Closed maximilianriemensberger closed 3 years ago

maximilianriemensberger commented 3 years ago
maximilianriemensberger commented 3 years ago

Note: I'm unsure whether the "A" -> "mA" change is complete and how it would interact with homeassistant.

alengwenus commented 3 years ago

@maximilianriemensberger great that you found this inconsitency! Different from your solution I would prefer to stick to SI units (Ampere in this case) wherever possible. This means we should change the conversion routines, not the unit itself. I know this differs from the representation in LCN-Pro but I wouldn't care about that. HomeAssistant also tries to stick to SI units. If pypck also uses SI units for the current, I wouldn't need to write a conversion exception within HomeAssistant.

maximilianriemensberger commented 3 years ago

That's totally fine for me as well. As long as value and the unit are consistent I'm totally happy :grinning:

maximilianriemensberger commented 3 years ago

@alengwenus I changed it back to A and adapted the conversion accordingly. Please review. Thanks.

alengwenus commented 3 years ago

Thanks @maximilianriemensberger