Skip to content

Commit a2b2414

Browse files
committed
fixed mistakes found by lint on pull request.
1 parent 3ca336e commit a2b2414

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

adafruit_bme680.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-FileCopyrightText: 2017 ladyada for Adafruit Industries
22
#
33
# SPDX-License-Identifier: MIT
4+
45
# garberw added begin ===========================
56
#
67
# BOSCH LICENSE
@@ -78,7 +79,7 @@
7879

7980

8081
def delay_microseconds(nusec):
81-
"""fixme must be same as dev->delay_us"""
82+
"""HELP must be same as dev->delay_us"""
8283
time.sleep(nusec / 1000000.0)
8384

8485
try:
@@ -568,7 +569,7 @@ def _set_heatr_conf(self, heater_temp: UINT16, heater_time: UINT16) -> None:
568569
_BME68X_RUN_GAS_POS, run_gas)
569570
self._write(ctrl_gas_addr_0, [ ctrl_gas_data_0 ])
570571
self._write(ctrl_gas_addr_1, [ ctrl_gas_data_1 ])
571-
# fixme check this
572+
# HELP check this
572573
self._set_op_mode(_BME68X_FORCED_MODE)
573574
except GasHeaterException as exc:
574575
self._set_op_mode(_BME68X_FORCED_MODE)
@@ -591,7 +592,7 @@ def _set_op_mode(self, op_mode: UINT8) -> None:
591592
if pow_mode != _BME68X_SLEEP_MODE:
592593
tmp_pow_mode &= ~_BME68X_MODE_MSK # Set to sleep
593594
self._write(reg_addr, [ tmp_pow_mode ])
594-
# dev->delay_us(_BME68X_PERIOD_POLL, dev->intf_ptr) # fixme
595+
# dev->delay_us(_BME68X_PERIOD_POLL, dev->intf_ptr) # HELP
595596
delay_microseconds(_BME68X_PERIOD_POLL)
596597
# Already in sleep
597598
if op_mode != _BME68X_SLEEP_MODE:
@@ -627,8 +628,7 @@ def _calc_res_heat(self, temp: UINT16) -> UINT8:
627628
htv: INT8 = self._heat_val
628629
amb: UINT8 = self._amb_temp
629630

630-
if temp > 400: # Cap temperature
631-
temp = 400
631+
temp = min(temp, 400) # Cap temperature
632632

633633
var1: INT32 = ((INT32(amb) * gh3) / 1000) * 256
634634
var2: INT32 = (gh1 + 784) * (((((gh2 + 154009) * temp * 5) / 100) + 3276800) / 10)
@@ -651,8 +651,7 @@ def _calc_res_heat(self, temp: UINT16) -> UINT8:
651651
htv: float = float(self._heat_val)
652652
amb: float = float(self._amb_temp)
653653

654-
if temp > 400: # Cap temperature
655-
temp = 400
654+
temp = min(temp, 400) # Cap temperature
656655

657656
var1: float = ((gh1 / (16.0)) + 49.0)
658657
var2: float = (((gh2 / (32768.0)) * (0.0005)) + 0.00235)

contributors.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
# SPDX-FileCopyrightText: 2017 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
14

25
Contributors to Adafruit_CircuitPython_BME680_modified
36
=============================================================
47

5-
William Garber
8+
Limor (Ladyada) Fried
69

10+
William Garber
11+
many others

0 commit comments

Comments
 (0)