Skip to content

add type information #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions adafruit_st7735r.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
https://circuitpython.org/downloads

"""
try:
# used for typing only
from typing import Any
except ImportError:
pass

import displayio

Expand Down Expand Up @@ -63,14 +68,26 @@
b"\x29\x80\x64" # _DISPON
)


# pylint: disable=too-few-public-methods
class ST7735R(displayio.Display):
"""ST7735 driver for ST7735R"""
"""
ST7735R display driver

:param displayio.FourWire bus: bus that the display is connected to
:param bool bgr: (Optional) An extra init sequence to append (default=False)
:param bool invert: (Optional) Invert the colors (default=False)
"""

def __init__(
self,
bus: displayio.FourWire,
*,
bgr: bool = False,
invert: bool = False,
**kwargs: Any
):

def __init__(self, bus, *, bgr=False, invert=False, **kwargs):
"""
:param bool bgr: (Optional) An extra init sequence to append (default=False)
"""
init_sequence = _INIT_SEQUENCE
if bgr:
init_sequence += (
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# digitalio, micropython and busio. List the modules you use. Without it, the
# autodoc module docs will fail to generate with a warning.
# autodoc_mock_imports = ["digitalio", "busio"]
autodoc_mock_imports = ["displayio"]

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