Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions aosong/am2315.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def data(self):
temp_H &=0x7F

tempC = (temp_H*256+temp_L)/10

if negative:
tempC = -abs(tempC)

tempF = self.c_to_f(tempC)

# Verify CRC here
Expand All @@ -146,10 +150,6 @@ def data(self):
self.lastError('CRC error in sensor data.')
return None

if negative:
tempC = -abs(tempC)
tempF = -abs(tempF)

return (humidity, tempC, tempF)


Expand Down