From 15497c2db06d4bfcc650d1c3dda174b28ec3bf4d Mon Sep 17 00:00:00 2001 From: jposada202020 Date: Mon, 26 Jun 2023 01:33:14 -0400 Subject: [PATCH] first commit --- micropython_mpl3115a2/mpl3115a2.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/micropython_mpl3115a2/mpl3115a2.py b/micropython_mpl3115a2/mpl3115a2.py index 9bca7aa..63a3800 100644 --- a/micropython_mpl3115a2/mpl3115a2.py +++ b/micropython_mpl3115a2/mpl3115a2.py @@ -18,11 +18,6 @@ from micropython import const from micropython_mpl3115a2.i2c_helpers import CBits, RegisterStruct -try: - from typing import Tuple -except ImportError: - pass - __version__ = "0.0.0+auto.0" __repo__ = "https://github.com/jposada202020/MicroPython_MPL3115A2.git" @@ -141,7 +136,7 @@ def oversample_ratio(self, value: int) -> None: self._oversample_ratio = value @property - def pressure(self): + def pressure(self) -> float: """ Read the barometric pressure detected by the sensor in Hectopascals. """ @@ -161,7 +156,7 @@ def pressure(self): return pressure / 400.0 - def _poll_reg1(self): + def _poll_reg1(self) -> None: """ Poll the ost_status to NOT be present. """ @@ -169,7 +164,7 @@ def _poll_reg1(self): time.sleep(0.01) @property - def altitude(self): + def altitude(self) -> float: """Read the altitude as calculated based on the sensor pressure and previously configured pressure at sea-level. This will return a value in meters. Set the sea-level pressure by updating the @@ -189,7 +184,7 @@ def altitude(self): return altitude / 65535.0 @property - def temperature(self): + def temperature(self) -> float: """ Read the temperature as measured by the sensor in Celsius. """