Closed kolcz closed 6 days ago
Is there a reason why this is not merged? From a practical point of view, it does not matter (one per-mill of a degree), but there is no reason to have it wrong. The only argument would be performance if you would use bit-shifting, but the code doesn't.
@bablokb I think it's just waiting for review / testing. Do you have access to one of these devices to test with?
I'm not familiar at all with this chip, and don't have one to test with. Are you familiar with the device? If so can you confirm the change is correct?
Yes I have these devices (both SCD40 and SCD41). And the change is correct.
Nevertheless, I propose a change. @kolcz: could you replace the 2**16-1
with a constant? It should have been a constant in the first place, but when you are already changing it, then I would suggest to make it a constant.
Sorry for the long response, but I have adventures with pre-commit checks. I have changed 2^16 -1 to exact value and added line comments with equations for clarity. I have made changes also in temperature_offset getter and setter. @bablokb please test the code now. @FoamyGuy I wait for your review.
I successfully tested the new code.
@FoamyGuy I think you can go ahead and merge the PR.
Add subtraction by 1 to denominator