Skip to content

Commit

Permalink
Merge pull request #39 from makermelissa/master
Browse files Browse the repository at this point in the history
Update to work on CircuitPython 9.0.0
  • Loading branch information
dhalbert authored Mar 19, 2024
2 parents 76dd808 + 1c1d086 commit 2e37857
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions adafruit_displayio_ssd1306.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@
https://github.com/adafruit/circuitpython/releases
"""

import displayio

try:
from typing import Union
from busdisplay import BusDisplay
from fourwire import FourWire
from i2cdisplaybus import I2CDisplayBus
except ImportError:
pass
from displayio import FourWire
from displayio import I2CDisplay as I2CDisplayBus
from displayio import Display as BusDisplay

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


class SSD1306(displayio.Display):
class SSD1306(BusDisplay):
"""
SSD1306 driver
Expand All @@ -70,9 +72,7 @@ class SSD1306(displayio.Display):
(0, 90, 180, 270)
"""

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

0 comments on commit 2e37857

Please sign in to comment.