- 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 return self.digits
def temperature(self): def temperature(self):
return self.__tempRaw() return self.__tempRaw() + self.temp_correction
def __tempRaw(self): def __tempRaw(self):
try: try:
@@ -47,7 +47,7 @@ class TempSensor_max31865(ATemperatureSensor):
except: except:
return None return None
R = TempSensor_max31865.calc_R(430, digits) 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)) print("Digits={}, R={:.3f} Ohm, T={:.2f} degC".format(digits, R, T))
return T return T