Skip to content

Add Missing Type Annotations #10

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
Sep 3, 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_displayio_sh1106.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class SH1106(displayio.Display):
:param int rotation: The rotation of the display. 0, 90, 180 or 270.
"""

def __init__(self, bus, **kwargs):
def __init__(self, bus: displayio.Fourwire, **kwargs) -> None:
init_sequence = bytearray(_INIT_SEQUENCE)
super().__init__(
bus,
Expand All @@ -83,15 +83,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.
"""
return self._is_awake

def sleep(self):
def sleep(self) -> None:
"""
Put display into sleep mode. The display uses < 5uA in sleep mode.

Expand All @@ -106,7 +106,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