Merge pull request #64 from tekktrik/doc/fix-typing
Update namedtuple type annotations
This commit is contained in:
commit
38870549ad
6 changed files with 7 additions and 28 deletions
|
|
@ -38,11 +38,6 @@ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
|
||||||
|
|
||||||
Buttons = namedtuple("Buttons", "a b")
|
Buttons = namedtuple("Buttons", "a b")
|
||||||
|
|
||||||
try:
|
|
||||||
from typing import Type
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class Clue(PyBadgerBase):
|
class Clue(PyBadgerBase):
|
||||||
"""Class that represents a single CLUE."""
|
"""Class that represents a single CLUE."""
|
||||||
|
|
@ -69,7 +64,7 @@ class Clue(PyBadgerBase):
|
||||||
self._buttons = KeyStates(self._keys)
|
self._buttons = KeyStates(self._keys)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def button(self) -> Type[tuple]:
|
def button(self) -> Buttons:
|
||||||
"""The buttons on the board.
|
"""The buttons on the board.
|
||||||
|
|
||||||
Example use:
|
Example use:
|
||||||
|
|
|
||||||
|
|
@ -38,10 +38,6 @@ import adafruit_lis3dh
|
||||||
import neopixel
|
import neopixel
|
||||||
from adafruit_pybadger.pybadger_base import PyBadgerBase, KeyStates
|
from adafruit_pybadger.pybadger_base import PyBadgerBase, KeyStates
|
||||||
|
|
||||||
try:
|
|
||||||
from typing import Type
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
__version__ = "0.0.0+auto.0"
|
__version__ = "0.0.0+auto.0"
|
||||||
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
|
||||||
|
|
@ -79,7 +75,7 @@ class CPB_Gizmo(PyBadgerBase):
|
||||||
self._light_sensor = analogio.AnalogIn(board.LIGHT)
|
self._light_sensor = analogio.AnalogIn(board.LIGHT)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def button(self) -> Type[tuple]:
|
def button(self) -> Buttons:
|
||||||
"""The buttons on the board.
|
"""The buttons on the board.
|
||||||
|
|
||||||
Example use:
|
Example use:
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,6 @@ import board
|
||||||
import neopixel
|
import neopixel
|
||||||
from adafruit_pybadger.pybadger_base import PyBadgerBase
|
from adafruit_pybadger.pybadger_base import PyBadgerBase
|
||||||
|
|
||||||
try:
|
|
||||||
from typing import Type
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
__version__ = "0.0.0+auto.0"
|
__version__ = "0.0.0+auto.0"
|
||||||
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
|
||||||
|
|
@ -55,7 +51,7 @@ class MagTag(PyBadgerBase):
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def button(self) -> Type[tuple]:
|
def button(self) -> Buttons:
|
||||||
"""The buttons on the board.
|
"""The buttons on the board.
|
||||||
|
|
||||||
Example use:
|
Example use:
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,6 @@ import audioio
|
||||||
import keypad
|
import keypad
|
||||||
from adafruit_pybadger.pybadger_base import PyBadgerBase, KeyStates
|
from adafruit_pybadger.pybadger_base import PyBadgerBase, KeyStates
|
||||||
|
|
||||||
try:
|
|
||||||
from typing import Type
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
__version__ = "0.0.0+auto.0"
|
__version__ = "0.0.0+auto.0"
|
||||||
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
|
||||||
|
|
@ -68,7 +64,7 @@ class PewPewM4(PyBadgerBase):
|
||||||
self._buttons = KeyStates(self._keys)
|
self._buttons = KeyStates(self._keys)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def button(self) -> Type[tuple]:
|
def button(self) -> Buttons:
|
||||||
"""The buttons on the board.
|
"""The buttons on the board.
|
||||||
|
|
||||||
Example use:
|
Example use:
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,6 @@ import adafruit_lis3dh
|
||||||
import neopixel
|
import neopixel
|
||||||
from adafruit_pybadger.pybadger_base import PyBadgerBase, KeyStates
|
from adafruit_pybadger.pybadger_base import PyBadgerBase, KeyStates
|
||||||
|
|
||||||
try:
|
|
||||||
from typing import Type
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
__version__ = "0.0.0+auto.0"
|
__version__ = "0.0.0+auto.0"
|
||||||
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PyBadger.git"
|
||||||
|
|
@ -105,7 +101,7 @@ class PyBadge(PyBadgerBase):
|
||||||
self._light_sensor = analogio.AnalogIn(board.A7)
|
self._light_sensor = analogio.AnalogIn(board.A7)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def button(self) -> Type[tuple]:
|
def button(self) -> Buttons:
|
||||||
"""The buttons on the board.
|
"""The buttons on the board.
|
||||||
|
|
||||||
Example use:
|
Example use:
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ import adafruit_lis3dh
|
||||||
from adafruit_pybadger.pybadger_base import PyBadgerBase, KeyStates
|
from adafruit_pybadger.pybadger_base import PyBadgerBase, KeyStates
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from typing import Type, Tuple
|
from typing import Tuple
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
@ -85,7 +85,7 @@ class PyGamer(PyBadgerBase):
|
||||||
self._light_sensor = analogio.AnalogIn(board.A7)
|
self._light_sensor = analogio.AnalogIn(board.A7)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def button(self) -> Type[tuple]:
|
def button(self) -> Buttons:
|
||||||
"""The buttons on the board.
|
"""The buttons on the board.
|
||||||
|
|
||||||
Example use:
|
Example use:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue