40
40
import adafruit_lis3dh
41
41
42
42
try :
43
- from circuitpython_typing . device_drivers import I2CDeviceDriver
44
- from typing import Optional
43
+ from busio import I2C
44
+ from typing import Optional , Dict , Union
45
45
except ImportError :
46
46
pass
47
47
@@ -68,7 +68,7 @@ class MonsterM4sk:
68
68
The right screen is the one USB port directly above it.
69
69
"""
70
70
71
- def __init__ (self , i2c : Optional [I2CDeviceDriver ] = None ):
71
+ def __init__ (self , i2c : Optional [I2C ] = None ):
72
72
"""
73
73
:param i2c: The I2C bus to use, will try board.I2C()
74
74
if not supplied
@@ -156,7 +156,7 @@ def __init__(self, i2c: Optional[I2CDeviceDriver] = None):
156
156
self .nose .threshold = 180
157
157
158
158
@property
159
- def acceleration (self ):
159
+ def acceleration (self ) -> Union [ float , None ] :
160
160
"""Accelerometer data, +/- 2G sensitivity.
161
161
162
162
This example initializes the mask and prints the accelerometer data.
@@ -175,7 +175,7 @@ def acceleration(self):
175
175
)
176
176
177
177
@property
178
- def light (self ):
178
+ def light (self ) -> int :
179
179
"""Light sensor data.
180
180
181
181
This example initializes the mask and prints the light sensor data.
@@ -190,7 +190,7 @@ def light(self):
190
190
return self ._ss .analog_read (SS_LIGHTSENSOR_PIN )
191
191
192
192
@property
193
- def buttons (self ):
193
+ def buttons (self ) -> Dict [ str , bool ] :
194
194
"""Buttons dictionary.
195
195
196
196
This example initializes the mask and prints when the S9 button
@@ -214,7 +214,7 @@ def buttons(self):
214
214
}
215
215
216
216
@property
217
- def boop (self ):
217
+ def boop (self ) -> bool :
218
218
"""Nose touch sense.
219
219
220
220
This example initializes the mask and prints when the nose touch pad
0 commit comments