Skip to content

Commit 8f884ce

Browse files
committed
use None instead of 0 for disable.
1 parent 53b814f commit 8f884ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_bme680.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,16 +484,16 @@ def _write(self, register: int, values: bytearray) -> None:
484484

485485
def set_gas_heater(self, heater_temp: UINT16, heater_time: UINT16) -> bool:
486486
"""
487-
* @brief Enable and configure gas reading + heater (0 disables)
487+
* @brief Enable and configure gas reading + heater (None disables)
488488
* @param heater_temp
489489
* Desired temperature in degrees Centigrade
490490
* @param heater_time
491491
* Time to keep heater on in milliseconds
492492
* @return True on success, False on failure
493493
"""
494494
try:
495-
if (heater_temp == 0) or (heater_time == 0):
496-
self._set_heatr_conf(heater_temp, heater_time, enable=False)
495+
if (heater_temp is None) or (heater_time is None):
496+
self._set_heatr_conf(heater_temp or 0, heater_time or 0, enable=False)
497497
else:
498498
self._set_heatr_conf(heater_temp, heater_time)
499499
except GasHeaterException:

0 commit comments

Comments
 (0)