mirror of
https://github.com/cmur2/python-bme680.git
synced 2024-12-22 22:54:29 +01:00
accept float values in set_temp_offset
This commit is contained in:
parent
1c9ba41306
commit
ae004aa62b
@ -65,9 +65,9 @@ class BME680(BME680Data):
|
|||||||
if value == 0:
|
if value == 0:
|
||||||
self.offset_temp_in_t_fine = 0
|
self.offset_temp_in_t_fine = 0
|
||||||
elif value < 0:
|
elif value < 0:
|
||||||
self.offset_temp_in_t_fine = -int((((abs(value) * 100) << 8) - 128) / 5)
|
self.offset_temp_in_t_fine = -int((((int(abs(value) * 100)) << 8) - 128) / 5)
|
||||||
else:
|
else:
|
||||||
self.offset_temp_in_t_fine = int((((abs(value) * 100) << 8) - 128) / 5)
|
self.offset_temp_in_t_fine = int((((int(abs(value) * 100)) << 8) - 128) / 5)
|
||||||
|
|
||||||
def set_humidity_oversample(self, value):
|
def set_humidity_oversample(self, value):
|
||||||
"""Set humidity oversampling
|
"""Set humidity oversampling
|
||||||
|
Loading…
Reference in New Issue
Block a user