bme280: Start temperature measurements from "klippy:connect" callback

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-12-01 11:22:12 -05:00
parent f3fd814ce0
commit 69f06054e1
1 changed files with 3 additions and 2 deletions

View File

@ -38,9 +38,10 @@ class BME280:
self.dig = None
self.sample_timer = self.reactor.register_timer(self._sample_bme280)
self.printer.add_object("bme280 " + self.name, self)
self.printer.register_event_handler("klippy:ready", self.handle_ready)
self.printer.register_event_handler("klippy:connect",
self.handle_connect)
def handle_ready(self):
def handle_connect(self):
self._init_bme280()
self.reactor.update_timer(self.sample_timer, self.reactor.NOW)