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 3838
3939Buttons = namedtuple ("Buttons" , "a b" )
4040
41+ try :
42+ from typing import Type
43+ except ImportError :
44+ pass
45+
4146
4247class Clue (PyBadgerBase ):
4348 """Class that represents a single CLUE."""
4449
4550 _audio_out = audiopwmio .PWMAudioOut
4651 _neopixel_count = 1
4752
48- def __init__ (self ):
53+ def __init__ (self ) -> None :
4954 super ().__init__ ()
5055
5156 i2c = board .I2C ()
@@ -64,7 +69,7 @@ def __init__(self):
6469 self ._buttons = KeyStates (self ._keys )
6570
6671 @property
67- def button (self ):
72+ def button (self ) -> Type [ tuple ] :
6873 """The buttons on the board.
6974
7075 Example use:
Original file line number Diff line number Diff line change 3838import neopixel
3939from adafruit_pybadger .pybadger_base import PyBadgerBase , KeyStates
4040
41+ try :
42+ from typing import Type
43+ except ImportError :
44+ pass
45+
4146__version__ = "0.0.0-auto.0"
4247__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
4348
@@ -51,7 +56,7 @@ class CPB_Gizmo(PyBadgerBase):
5156 _audio_out = audiopwmio .PWMAudioOut
5257 _neopixel_count = 10
5358
54- def __init__ (self ):
59+ def __init__ (self ) -> None :
5560 super ().__init__ ()
5661
5762 _i2c = busio .I2C (board .ACCELEROMETER_SCL , board .ACCELEROMETER_SDA )
@@ -74,7 +79,7 @@ def __init__(self):
7479 self ._light_sensor = analogio .AnalogIn (board .LIGHT )
7580
7681 @property
77- def button (self ):
82+ def button (self ) -> Type [ tuple ] :
7883 """The buttons on the board.
7984
8085 Example use:
Original file line number Diff line number Diff line change 3030import neopixel
3131from adafruit_pybadger .pybadger_base import PyBadgerBase
3232
33+ try :
34+ from typing import Type
35+ except ImportError :
36+ pass
37+
3338__version__ = "0.0.0-auto.0"
3439__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
3540
@@ -41,7 +46,7 @@ class MagTag(PyBadgerBase):
4146
4247 _neopixel_count = 4
4348
44- def __init__ (self ):
49+ def __init__ (self ) -> None :
4550 super ().__init__ ()
4651
4752 # NeoPixels
@@ -50,7 +55,7 @@ def __init__(self):
5055 )
5156
5257 @property
53- def button (self ):
58+ def button (self ) -> Type [ tuple ] :
5459 """The buttons on the board.
5560
5661 Example use:
Original file line number Diff line number Diff line change 3131import keypad
3232from adafruit_pybadger .pybadger_base import PyBadgerBase , KeyStates
3333
34+ try :
35+ from typing import Type
36+ except ImportError :
37+ pass
38+
3439__version__ = "0.0.0-auto.0"
3540__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
3641
@@ -43,7 +48,7 @@ class PewPewM4(PyBadgerBase):
4348 _audio_out = audioio .AudioOut
4449 _neopixel_count = 0
4550
46- def __init__ (self ):
51+ def __init__ (self ) -> None :
4752 super ().__init__ ()
4853
4954 self ._keys = keypad .Keys (
@@ -63,7 +68,7 @@ def __init__(self):
6368 self ._buttons = KeyStates (self ._keys )
6469
6570 @property
66- def button (self ):
71+ def button (self ) -> Type [ tuple ] :
6772 """The buttons on the board.
6873
6974 Example use:
Original file line number Diff line number Diff line change 4040import neopixel
4141from adafruit_pybadger .pybadger_base import PyBadgerBase , KeyStates
4242
43+ try :
44+ from typing import Type
45+ except ImportError :
46+ pass
47+
4348__version__ = "0.0.0-auto.0"
4449__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
4550
@@ -52,7 +57,7 @@ class PyBadge(PyBadgerBase):
5257 _audio_out = audioio .AudioOut
5358 _neopixel_count = 5
5459
55- def __init__ (self ):
60+ def __init__ (self ) -> None :
5661 super ().__init__ ()
5762
5863 i2c = None
@@ -100,7 +105,7 @@ def __init__(self):
100105 self ._light_sensor = analogio .AnalogIn (board .A7 )
101106
102107 @property
103- def button (self ):
108+ def button (self ) -> Type [ tuple ] :
104109 """The buttons on the board.
105110
106111 Example use:
You can’t perform that action at this time.
0 commit comments