This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Description
In your code for altitude you have
altitude = 44330.0 * (
1.0 - ((self.pressure / self.sea_level_pressure) ** 0.190284)
)
return round(altitude, 1)
In the Bosch Sensor guide (ex: in bmp180 they show a different formula page 16 of: https://cdn-shop.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf).
Since you are raising the difference in pressure & SLP to a power small differences can make a difference.
Consider this return value instead, because it eliminates the over rounding of altitude limits accuracy to 100cm on device capable of a couple of centimeters:
altitude = 44330.0 * (
1.0 - ((self.pressure / self.sea_level_pressure) ** (1.0 / 5.255))
)
return altitude