Skip to content

Commit 2e37857

Browse files
authored
Merge pull request #39 from makermelissa/master
Update to work on CircuitPython 9.0.0
2 parents 76dd808 + 1c1d086 commit 2e37857

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

adafruit_displayio_ssd1306.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@
3131
https://github.com/adafruit/circuitpython/releases
3232
3333
"""
34-
35-
import displayio
36-
3734
try:
3835
from typing import Union
36+
from busdisplay import BusDisplay
37+
from fourwire import FourWire
38+
from i2cdisplaybus import I2CDisplayBus
3939
except ImportError:
40-
pass
40+
from displayio import FourWire
41+
from displayio import I2CDisplay as I2CDisplayBus
42+
from displayio import Display as BusDisplay
4143

4244
__version__ = "0.0.0+auto.0"
4345
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306.git"
@@ -60,7 +62,7 @@
6062
)
6163

6264

63-
class SSD1306(displayio.Display):
65+
class SSD1306(BusDisplay):
6466
"""
6567
SSD1306 driver
6668
@@ -70,9 +72,7 @@ class SSD1306(displayio.Display):
7072
(0, 90, 180, 270)
7173
"""
7274

73-
def __init__(
74-
self, bus: Union[displayio.FourWire, displayio.I2CDisplay], **kwargs
75-
) -> None:
75+
def __init__(self, bus: Union[FourWire, I2CDisplayBus], **kwargs) -> None:
7676
# Patch the init sequence for 32 pixel high displays.
7777
init_sequence = bytearray(_INIT_SEQUENCE)
7878
height = kwargs["height"]

0 commit comments

Comments
 (0)