From db4626f370472b2d637481afa4fe767c81a03904 Mon Sep 17 00:00:00 2001 From: cn Date: Mon, 24 Dec 2018 23:18:33 +0100 Subject: [PATCH] Use fixed ambient_temperature on first gas reading, it's nearly irrelevant Note: on subsequent gas measurements the last temperature instead of 25 degree C will be used. Nearly irrelevant because this happens to return value of _calc_heater_resistance(200): ambient_temperature = 30 -> int(84.9119287004) ambient_temperature = 25 -> int(84.9119068473) ambient_temperature = 20 -> int(84.9118849941) ambient_temperature = 10 -> int(84.9118412877) --- library/bme680/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/library/bme680/__init__.py b/library/bme680/__init__.py index df65555..92c541b 100644 --- a/library/bme680/__init__.py +++ b/library/bme680/__init__.py @@ -51,6 +51,7 @@ class BME680(BME680Data): self._get_calibration_data() self.set_temp_offset(0) + self.ambient_temperature = 25 # only for gas heater temperature, nearly irrelevant def _get_calibration_data(self): """Retrieve the sensor calibration data and store it in .calibration_data."""