Skip to content

Commit 2aaaf1b

Browse files
committed
fix pylint issue
1 parent c8dbbdb commit 2aaaf1b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

adafruit_dht.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ def measure(self):
160160
self._temperature = buf[2]
161161
else:
162162
# temperature is 2 bytes
163-
# MSB ist sign, bits 0-14 are magnitude)
164-
self._temperature = (((buf[2] & 0x7f)<<8) | buf[3]) / 10
163+
# MSB is sign, bits 0-14 are magnitude)
164+
raw_temperature = (((buf[2] & 0x7f)<<8) | buf[3]) / 10
165165
# set sign
166166
if buf[2] & 0x80:
167-
self._temperature = -self._temperature
168-
167+
raw_temperature = -raw_temperature
168+
self._temperature = raw_temperature
169169
# calc checksum
170170
chk_sum = 0
171171
for b in buf[0:4]:
@@ -176,7 +176,6 @@ def measure(self):
176176
# check sum failed to validate
177177
raise RuntimeError("Checksum did not validate. Try again.")
178178

179-
180179
else:
181180
raise RuntimeError("A full buffer was not returned. Try again.")
182181

0 commit comments

Comments
 (0)