Skip to content

Commit 1c1d086

Browse files
committed
Update to still work on older displayio
1 parent 62e86d4 commit 1c1d086

File tree

2 files changed

+8
-149
lines changed

2 files changed

+8
-149
lines changed

adafruit_displayio_ssd1306.new.py

Lines changed: 0 additions & 140 deletions
This file was deleted.

adafruit_displayio_ssd1306.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@
3131
https://github.com/adafruit/circuitpython/releases
3232
3333
"""
34-
35-
import busdisplay
3634
try:
3735
from typing import Union
38-
import fourwire
39-
import i2cdisplaybus
36+
from busdisplay import BusDisplay
37+
from fourwire import FourWire
38+
from i2cdisplaybus import I2CDisplayBus
4039
except ImportError:
41-
pass
40+
from displayio import FourWire
41+
from displayio import I2CDisplay as I2CDisplayBus
42+
from displayio import Display as BusDisplay
4243

4344
__version__ = "0.0.0+auto.0"
4445
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306.git"
@@ -61,7 +62,7 @@
6162
)
6263

6364

64-
class SSD1306(busdisplay.BusDisplay):
65+
class SSD1306(BusDisplay):
6566
"""
6667
SSD1306 driver
6768
@@ -71,9 +72,7 @@ class SSD1306(busdisplay.BusDisplay):
7172
(0, 90, 180, 270)
7273
"""
7374

74-
def __init__(
75-
self, bus: Union[fourwire.FourWire, i2cdisplaybus.I2CDisplayBus], **kwargs
76-
) -> None:
75+
def __init__(self, bus: Union[FourWire, I2CDisplayBus], **kwargs) -> None:
7776
# Patch the init sequence for 32 pixel high displays.
7877
init_sequence = bytearray(_INIT_SEQUENCE)
7978
height = kwargs["height"]

0 commit comments

Comments
 (0)