Skip to content
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

Update HX8357 driver to 8.x/9.x transitional code #23

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Changes from 2 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
13 changes: 9 additions & 4 deletions adafruit_hx8357.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@
"""

# imports

import displayio
# Support both 8.x.x and 9.x.x. Removed 8.x method when discontinued.
try:
from fourwire import FourWire # 9.x method
from busdisplay import BusDisplay
except ImportError:
from displayio import FourWire # 8.x method
from displayio import Display as BusDisplay

__version__ = "0.0.0+auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_HX8357.git"
Expand Down Expand Up @@ -58,8 +63,8 @@


# pylint: disable=too-few-public-methods
class HX8357(displayio.Display):
class HX8357(BusDisplay):
"""HX8357D driver"""

def __init__(self, bus: displayio.FourWire, **kwargs) -> None:
def __init__(self, bus: FourWire.FourWire, **kwargs) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type annotation now just be FourWire, but this is great, thanks!

super().__init__(bus, _INIT_SEQUENCE, **kwargs)
Loading