39
39
from adafruit_st7789 import ST7789
40
40
import adafruit_lis3dh
41
41
42
+ try :
43
+ from typing import Optional , Dict , Union
44
+ from busio import I2C
45
+ except ImportError :
46
+ pass
47
+
42
48
__version__ = "0.0.0+auto.0"
43
49
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MONSTERM4SK.git"
44
50
@@ -62,7 +68,7 @@ class MonsterM4sk:
62
68
The right screen is the one USB port directly above it.
63
69
"""
64
70
65
- def __init__ (self , i2c = None ):
71
+ def __init__ (self , i2c : Optional [ I2C ] = None ):
66
72
"""
67
73
:param i2c: The I2C bus to use, will try board.I2C()
68
74
if not supplied
@@ -150,7 +156,7 @@ def __init__(self, i2c=None):
150
156
self .nose .threshold = 180
151
157
152
158
@property
153
- def acceleration (self ):
159
+ def acceleration (self ) -> Union [ float , None ] :
154
160
"""Accelerometer data, +/- 2G sensitivity.
155
161
156
162
This example initializes the mask and prints the accelerometer data.
@@ -169,7 +175,7 @@ def acceleration(self):
169
175
)
170
176
171
177
@property
172
- def light (self ):
178
+ def light (self ) -> int :
173
179
"""Light sensor data.
174
180
175
181
This example initializes the mask and prints the light sensor data.
@@ -184,7 +190,7 @@ def light(self):
184
190
return self ._ss .analog_read (SS_LIGHTSENSOR_PIN )
185
191
186
192
@property
187
- def buttons (self ):
193
+ def buttons (self ) -> Dict [ str , bool ] :
188
194
"""Buttons dictionary.
189
195
190
196
This example initializes the mask and prints when the S9 button
@@ -208,7 +214,7 @@ def buttons(self):
208
214
}
209
215
210
216
@property
211
- def boop (self ):
217
+ def boop (self ) -> bool :
212
218
"""Nose touch sense.
213
219
214
220
This example initializes the mask and prints when the nose touch pad
0 commit comments