aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArksine <arksine.code@gmail.com>2020-06-14 19:34:32 -0400
committerKevinOConnor <kevin@koconnor.net>2020-06-16 09:53:10 -0400
commit4c571ea9ac188678d538572e533005731203adf3 (patch)
tree4b4a6fd3ded6fd626171f8ea38dcc9ff192b782e
parent65ae08ef21a239e5cae1503a00c1ad0efb97726f (diff)
downloadkutter-4c571ea9ac188678d538572e533005731203adf3.tar.gz
kutter-4c571ea9ac188678d538572e533005731203adf3.tar.xz
kutter-4c571ea9ac188678d538572e533005731203adf3.zip
bme280: fix reported measured time
This allows the bme280 to correctly work with the temperature_fan module. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
-rw-r--r--klippy/extras/bme280.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/klippy/extras/bme280.py b/klippy/extras/bme280.py
index 89b3556b..814144a9 100644
--- a/klippy/extras/bme280.py
+++ b/klippy/extras/bme280.py
@@ -27,6 +27,7 @@ class BME280:
self.reactor = self.printer.get_reactor()
self.i2c = bus.MCU_I2C_from_config(
config, default_addr=BME280_CHIP_ADDR, default_speed=100000)
+ self.mcu = self.i2c.get_mcu()
self.os_temp = config.getint('bme280_oversample_temp', 2)
self.os_hum = config.getint('bme280_oversample_hum', 2)
self.os_pres = config.getint('bme280_oversample_pressure', 2)
@@ -132,7 +133,7 @@ class BME280:
self.pressure = self._compensate_pressure(pressure_raw) / 100.
self.humidity = self._compensate_humidity(humid_raw)
measured_time = self.reactor.monotonic()
- self._callback(measured_time, self.temp)
+ self._callback(self.mcu.estimated_print_time(measured_time), self.temp)
return measured_time + REPORT_TIME
def _compensate_temp(self, raw_temp):