Skip to content

Commit 7693575

Browse files
committed
Update HX8357 driver to 8.x/9.x transitional code
TFT FEatherwing display driver needs updating for 9.0
1 parent e0b977a commit 7693575

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

adafruit_hx8357.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,19 @@
3030

3131
# imports
3232

33-
import displayio
33+
try:
34+
# used for typing only
35+
from typing import Any
36+
except ImportError:
37+
pass
38+
39+
# Support both 8.x.x and 9.x.x. Change when 8.x.x is discontinued as a stable release.
40+
try:
41+
from fourwire import FourWire # 9.x method
42+
from busdisplay import BusDisplay
43+
except ImportError:
44+
from displayio import FourWire # 8.x method
45+
from displayio import Display as BusDisplay
3446

3547
__version__ = "0.0.0+auto.0"
3648
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_HX8357.git"
@@ -58,8 +70,8 @@
5870

5971

6072
# pylint: disable=too-few-public-methods
61-
class HX8357(displayio.Display):
73+
class HX8357(BusDisplay):
6274
"""HX8357D driver"""
6375

64-
def __init__(self, bus: displayio.FourWire, **kwargs) -> None:
76+
def __init__(self, bus: FourWire.FourWire, **kwargs) -> None:
6577
super().__init__(bus, _INIT_SEQUENCE, **kwargs)

0 commit comments

Comments
 (0)