- refactored temperature correction

This commit is contained in:
jens
2020-12-14 17:36:15 +01:00
parent 77dbca72ba
commit 1ad33b488f
+2 -2
View File
@@ -39,7 +39,7 @@ class TempSensor_max31865(ATemperatureSensor):
return self.digits
def temperature(self):
return self.__tempRaw()
return self.__tempRaw() + self.temp_correction
def __tempRaw(self):
try:
@@ -47,7 +47,7 @@ class TempSensor_max31865(ATemperatureSensor):
except:
return None
R = TempSensor_max31865.calc_R(430, digits)
T = TempSensor_max31865.vanDusen_temp(R) + self.temp_correction
T = TempSensor_max31865.vanDusen_temp(R)
print("Digits={}, R={:.3f} Ohm, T={:.2f} degC".format(digits, R, T))
return T