Skip to content

Commit

Permalink
be exact about length of byte array matching what we're unpacking (CP…
Browse files Browse the repository at this point in the history
…ython cares!)
  • Loading branch information
ladyada committed Aug 12, 2018
1 parent 3560378 commit 2d71629
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adafruit_bme680.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _read_calibration(self):
coeff = self._read(_BME680_BME680_COEFF_ADDR1, 25)
coeff += self._read(_BME680_BME680_COEFF_ADDR2, 16)

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

0 comments on commit 2d71629

Please sign in to comment.