We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8cb0dea commit fed191eCopy full SHA for fed191e
1 file changed
library/bme680/__init__.py
@@ -60,14 +60,12 @@ def set_temp_offset(self, value):
60
"""Set temperature offset in celsius
61
62
If set, the temperature t_fine will be increased by given value in celsius.
63
- :param value: Temperature offset in Celsius, eg. 4, -8
+ :param value: Temperature offset in Celsius, eg. 4, -8, 1.25
64
"""
65
if value == 0:
66
self.offset_temp_in_t_fine = 0
67
elif value < 0:
68
- self.offset_temp_in_t_fine = -int((((int(abs(value) * 100)) << 8) - 128) / 5)
69
- else:
70
- self.offset_temp_in_t_fine = int((((int(abs(value) * 100)) << 8) - 128) / 5)
+ self.offset_temp_in_t_fine = int(math.copysign((((int(abs(value) * 100)) << 8) - 128) / 5, value))
71
72
def set_humidity_oversample(self, value):
73
"""Set humidity oversampling
0 commit comments