File tree Expand file tree Collapse file tree 8 files changed +167
-112
lines changed Expand file tree Collapse file tree 8 files changed +167
-112
lines changed Original file line number Diff line number Diff line change 38
38
39
39
Buttons = namedtuple ("Buttons" , "a b" )
40
40
41
+ try :
42
+ from typing import Type
43
+ except ImportError :
44
+ pass
45
+
41
46
42
47
class Clue (PyBadgerBase ):
43
48
"""Class that represents a single CLUE."""
44
49
45
50
_audio_out = audiopwmio .PWMAudioOut
46
51
_neopixel_count = 1
47
52
48
- def __init__ (self ):
53
+ def __init__ (self ) -> None :
49
54
super ().__init__ ()
50
55
51
56
i2c = board .I2C ()
@@ -64,7 +69,7 @@ def __init__(self):
64
69
self ._buttons = KeyStates (self ._keys )
65
70
66
71
@property
67
- def button (self ):
72
+ def button (self ) -> Type [ tuple ] :
68
73
"""The buttons on the board.
69
74
70
75
Example use:
Original file line number Diff line number Diff line change 38
38
import neopixel
39
39
from adafruit_pybadger .pybadger_base import PyBadgerBase , KeyStates
40
40
41
+ try :
42
+ from typing import Type
43
+ except ImportError :
44
+ pass
45
+
41
46
__version__ = "0.0.0-auto.0"
42
47
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
43
48
@@ -51,7 +56,7 @@ class CPB_Gizmo(PyBadgerBase):
51
56
_audio_out = audiopwmio .PWMAudioOut
52
57
_neopixel_count = 10
53
58
54
- def __init__ (self ):
59
+ def __init__ (self ) -> None :
55
60
super ().__init__ ()
56
61
57
62
_i2c = busio .I2C (board .ACCELEROMETER_SCL , board .ACCELEROMETER_SDA )
@@ -74,7 +79,7 @@ def __init__(self):
74
79
self ._light_sensor = analogio .AnalogIn (board .LIGHT )
75
80
76
81
@property
77
- def button (self ):
82
+ def button (self ) -> Type [ tuple ] :
78
83
"""The buttons on the board.
79
84
80
85
Example use:
Original file line number Diff line number Diff line change 30
30
import neopixel
31
31
from adafruit_pybadger .pybadger_base import PyBadgerBase
32
32
33
+ try :
34
+ from typing import Type
35
+ except ImportError :
36
+ pass
37
+
33
38
__version__ = "0.0.0-auto.0"
34
39
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
35
40
@@ -41,7 +46,7 @@ class MagTag(PyBadgerBase):
41
46
42
47
_neopixel_count = 4
43
48
44
- def __init__ (self ):
49
+ def __init__ (self ) -> None :
45
50
super ().__init__ ()
46
51
47
52
# NeoPixels
@@ -50,7 +55,7 @@ def __init__(self):
50
55
)
51
56
52
57
@property
53
- def button (self ):
58
+ def button (self ) -> Type [ tuple ] :
54
59
"""The buttons on the board.
55
60
56
61
Example use:
Original file line number Diff line number Diff line change 31
31
import keypad
32
32
from adafruit_pybadger .pybadger_base import PyBadgerBase , KeyStates
33
33
34
+ try :
35
+ from typing import Type
36
+ except ImportError :
37
+ pass
38
+
34
39
__version__ = "0.0.0-auto.0"
35
40
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
36
41
@@ -43,7 +48,7 @@ class PewPewM4(PyBadgerBase):
43
48
_audio_out = audioio .AudioOut
44
49
_neopixel_count = 0
45
50
46
- def __init__ (self ):
51
+ def __init__ (self ) -> None :
47
52
super ().__init__ ()
48
53
49
54
self ._keys = keypad .Keys (
@@ -63,7 +68,7 @@ def __init__(self):
63
68
self ._buttons = KeyStates (self ._keys )
64
69
65
70
@property
66
- def button (self ):
71
+ def button (self ) -> Type [ tuple ] :
67
72
"""The buttons on the board.
68
73
69
74
Example use:
Original file line number Diff line number Diff line change 40
40
import neopixel
41
41
from adafruit_pybadger .pybadger_base import PyBadgerBase , KeyStates
42
42
43
+ try :
44
+ from typing import Type
45
+ except ImportError :
46
+ pass
47
+
43
48
__version__ = "0.0.0-auto.0"
44
49
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
45
50
@@ -52,7 +57,7 @@ class PyBadge(PyBadgerBase):
52
57
_audio_out = audioio .AudioOut
53
58
_neopixel_count = 5
54
59
55
- def __init__ (self ):
60
+ def __init__ (self ) -> None :
56
61
super ().__init__ ()
57
62
58
63
i2c = None
@@ -100,7 +105,7 @@ def __init__(self):
100
105
self ._light_sensor = analogio .AnalogIn (board .A7 )
101
106
102
107
@property
103
- def button (self ):
108
+ def button (self ) -> Type [ tuple ] :
104
109
"""The buttons on the board.
105
110
106
111
Example use:
You can’t perform that action at this time.
0 commit comments