Skip to content

Commit f97a077

Browse files
committed
fallback for Fourwire and EPaperDisplay. add displayio to mock docs
1 parent 50deff3 commit f97a077

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

adafruit_acep7in.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@
2121
2222
"""
2323

24-
import displayio
24+
# For 8.x.x and 9.x.x. When 8.x.x is discontinued as a stable release, change this.
25+
try:
26+
from fourwire import FourWire
27+
from epaperdisplay import EPaperDisplay
28+
except ImportError:
29+
from displayio import FourWire
30+
from displayio import EPaperDisplay
2531

2632
__version__ = "0.0.0+auto.0"
2733
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_ACeP7In.git"
@@ -53,7 +59,7 @@
5359

5460

5561
# pylint: disable=too-few-public-methods
56-
class ACeP7In(displayio.EPaperDisplay):
62+
class ACeP7In(EPaperDisplay):
5763
r"""Display driver for 7" ACeP epaper display. Driver IC name is unknown.
5864
5965
:param bus: The data bus the display is on
@@ -69,7 +75,7 @@ class ACeP7In(displayio.EPaperDisplay):
6975
Display rotation
7076
"""
7177

72-
def __init__(self, bus, **kwargs):
78+
def __init__(self, bus: FourWire, **kwargs):
7379
width = kwargs["width"]
7480
height = kwargs["height"]
7581
if "rotation" in kwargs and kwargs["rotation"] % 180 != 0:

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# Uncomment the below if you use native CircuitPython modules such as
2828
# digitalio, micropython and busio. List the modules you use. Without it, the
2929
# autodoc module docs will fail to generate with a warning.
30-
# autodoc_mock_imports = ["digitalio", "busio"]
30+
autodoc_mock_imports = ["displayio"]
3131

3232
autodoc_preserve_defaults = True
3333

0 commit comments

Comments
 (0)