Deal with negative temperatures
ChristianKuehnel opened this issue ยท 2 comments
ChristianKuehnel commented
As temperatures can be negative (at least in some countries ๐ ), we need to implement a conversion of negative temperatures to float.
Tasks:
- figure out how negative temperatures are encoded (e.g. one's complement)
- implement a solution
- add tests for negative temperatures
namanshenoy commented
Hey!
What are data[0] and data[1] in miflora/miflora_poller.py, def _parse_data?
ChristianKuehnel commented
Hey @namanshenoy,
That was fast ๐
From my understanding these are 2 bytes that we receive from the sensor. They somehow contain the temperature measured by the sensor. I'm not fully sure how to decode these values properly.
I guess the best idea is to put the sensor in the freezer (<0ยฐC), look at the values the app reports and then try to figure out how to decode negative temperatures based on the values of data[0] and data[1].