Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to work on CircuitPython 9.0.0 #39

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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