Skip to content

Commit 8e44aea

Browse files
committed
Bug Fix: Prevent Displaying Temperatures Below 0C
When in Celsius mode with standard ADC, prevent showing temperatures below 0C. This will prevent probes that are unconnected show a negative temperature on the dashboard.
1 parent 8a8c260 commit 8e44aea

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

probes/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ def _voltage_to_temp(self, voltage, probe_profile, port=None):
172172

173173
tempF = tempC * (9/5) + 32 # Celsius to Farenheit
174174

175-
''' Check bounds for realistic temperature values (0-600F), else report 0F '''
175+
''' Check bounds for realistic temperature values (ex. 0-600F, 0-314C), else report 0 '''
176176
if (tempF < 0) or (tempF > 600):
177177
tempF = 0
178+
if (tempC < 0) or (tempC > 314):
178179
tempC = 0
179180

180181
else:

0 commit comments

Comments
 (0)