Skip to content

Commit

Permalink
Update read_ds18b20.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JavanXD committed Apr 21, 2020
1 parent ed3d3cc commit 7364be6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions read_ds18b20.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def read_unfiltered_temperatur_values(sensorIndex, sensor):
temperature = None
try:
temperature = measure_temperature(sensor)
print("temperature for device '" + str(sensor["device_id"]) + "': " + str(temperature))

if math.isnan(temperature) == False:
if temperature is not None and math.isnan(temperature) == False:
print("temperature for device '" + str(sensor["device_id"]) + "': " + str(temperature))
unfiltered_values[sensorIndex].append(temperature)

except IOError as ex1:
Expand Down

0 comments on commit 7364be6

Please sign in to comment.