htu21d: sensor definition fix (#4075)

HTU21D sensor class lacked the method `get_report_time_delta` invoked
during watermark control loops. This short fix simply adds that method
in, calling the `self.report_time` attribute created during class
construction.

Signed-off-by: Jon Sanders <jonsan@gmail.com>
This commit is contained in:
Jon Sanders 2021-03-18 23:38:07 -04:00 committed by GitHub
parent 2144f716f6
commit 6c9404ac0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -109,6 +109,9 @@ class HTU21D:
def setup_callback(self, cb): def setup_callback(self, cb):
self._callback = cb self._callback = cb
def get_report_time_delta(self):
return self.report_time
def _init_htu21d(self): def _init_htu21d(self):
# Device Soft Reset # Device Soft Reset
self.i2c.i2c_write([HTU21D_COMMANDS['RESET']]) self.i2c.i2c_write([HTU21D_COMMANDS['RESET']])