Skip to content

Commit 2d71629

Browse files
committed
be exact about length of byte array matching what we're unpacking (CPython cares!)
1 parent 3560378 commit 2d71629

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_bme680.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def _read_calibration(self):
288288
coeff = self._read(_BME680_BME680_COEFF_ADDR1, 25)
289289
coeff += self._read(_BME680_BME680_COEFF_ADDR2, 16)
290290

291-
coeff = list(struct.unpack('<hbBHhbBhhbbHhhBBBHbbbBbHhbb', bytes(coeff[1:])))
291+
coeff = list(struct.unpack('<hbBHhbBhhbbHhhBBBHbbbBbHhbb', bytes(coeff[1:39])))
292292
#print("\n\n",coeff)
293293
coeff = [float(i) for i in coeff]
294294
self._temp_calibration = [coeff[x] for x in [23, 0, 1]]

0 commit comments

Comments
 (0)