diff --git a/adafruit_monsterm4sk.py b/adafruit_monsterm4sk.py index bb044bb..b4ca026 100644 --- a/adafruit_monsterm4sk.py +++ b/adafruit_monsterm4sk.py @@ -39,6 +39,12 @@ from adafruit_st7789 import ST7789 import adafruit_lis3dh +try: + from typing import Optional, Dict, Union + from busio import I2C +except ImportError: + pass + __version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MONSTERM4SK.git" @@ -62,7 +68,7 @@ class MonsterM4sk: The right screen is the one USB port directly above it. """ - def __init__(self, i2c=None): + def __init__(self, i2c: Optional[I2C] = None): """ :param i2c: The I2C bus to use, will try board.I2C() if not supplied @@ -150,7 +156,7 @@ def __init__(self, i2c=None): self.nose.threshold = 180 @property - def acceleration(self): + def acceleration(self) -> Union[float, None]: """Accelerometer data, +/- 2G sensitivity. This example initializes the mask and prints the accelerometer data. @@ -169,7 +175,7 @@ def acceleration(self): ) @property - def light(self): + def light(self) -> int: """Light sensor data. This example initializes the mask and prints the light sensor data. @@ -184,7 +190,7 @@ def light(self): return self._ss.analog_read(SS_LIGHTSENSOR_PIN) @property - def buttons(self): + def buttons(self) -> Dict[str, bool]: """Buttons dictionary. This example initializes the mask and prints when the S9 button @@ -208,7 +214,7 @@ def buttons(self): } @property - def boop(self): + def boop(self) -> bool: """Nose touch sense. This example initializes the mask and prints when the nose touch pad