Skip to content

Commit e511ac3

Browse files
authored
Merge pull request #27 from FoamyGuy/type_info
add type information
2 parents 2f55661 + 0c31e83 commit e511ac3

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

adafruit_st7735r.py

+22-5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
https://circuitpython.org/downloads
3434
3535
"""
36+
try:
37+
# used for typing only
38+
from typing import Any
39+
except ImportError:
40+
pass
3641

3742
import displayio
3843

@@ -63,14 +68,26 @@
6368
b"\x29\x80\x64" # _DISPON
6469
)
6570

71+
6672
# pylint: disable=too-few-public-methods
6773
class ST7735R(displayio.Display):
68-
"""ST7735 driver for ST7735R"""
74+
"""
75+
ST7735R display driver
76+
77+
:param displayio.FourWire bus: bus that the display is connected to
78+
:param bool bgr: (Optional) An extra init sequence to append (default=False)
79+
:param bool invert: (Optional) Invert the colors (default=False)
80+
"""
81+
82+
def __init__(
83+
self,
84+
bus: displayio.FourWire,
85+
*,
86+
bgr: bool = False,
87+
invert: bool = False,
88+
**kwargs: Any
89+
):
6990

70-
def __init__(self, bus, *, bgr=False, invert=False, **kwargs):
71-
"""
72-
:param bool bgr: (Optional) An extra init sequence to append (default=False)
73-
"""
7491
init_sequence = _INIT_SEQUENCE
7592
if bgr:
7693
init_sequence += (

docs/conf.py

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
# digitalio, micropython and busio. List the modules you use. Without it, the
2727
# autodoc module docs will fail to generate with a warning.
2828
# autodoc_mock_imports = ["digitalio", "busio"]
29-
autodoc_mock_imports = ["displayio"]
3029

3130
intersphinx_mapping = {
3231
"python": ("https://docs.python.org/3.4", None),

0 commit comments

Comments
 (0)