Skip to content

resolves #13 Missing Type Annotations #17

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
Aug 24, 2022
Merged
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
8 changes: 4 additions & 4 deletions adafruit_ssd1322.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class SSD1322(displayio.Display):
(0, 90, 180, 270)
"""

def __init__(self, bus, **kwargs):
def __init__(self, bus: displayio.FourWire, **kwargs) -> None:
# Patch the init sequence for 32 pixel high displays.
init_sequence = bytearray(_INIT_SEQUENCE)
height = kwargs["height"]
Expand All @@ -96,15 +96,15 @@ def __init__(self, bus, **kwargs):
self._is_awake = True # Display starts in active state (_INIT_SEQUENCE)

@property
def is_awake(self):
def is_awake(self) -> bool:
"""
The power state of the display. (read-only)
`True` if the display is active, `False` if in sleep mode.
:type: bool
"""
return self._is_awake

def sleep(self):
def sleep(self) -> None:
"""
Put display into sleep mode.
Display uses < 10uA in sleep mode. Display remembers display data and operation mode
Expand All @@ -114,7 +114,7 @@ def sleep(self):
self.bus.send(0xAE, b"") # 0xAE = display off, sleep mode
self._is_awake = False

def wake(self):
def wake(self) -> None:
"""
Wake display from sleep mode
"""
Expand Down