Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion adafruit_displayio_sh1106.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,18 @@
"""

# Support both 8.x.x and 9.x.x. Change when 8.x.x is discontinued as a stable release.
try:
from typing import Union
except ImportError:
pass

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

__version__ = "0.0.0+auto.0"
Expand Down Expand Up @@ -67,7 +74,7 @@ class SH1106(BusDisplay):
:param int rotation: The rotation of the display. 0, 90, 180 or 270.
"""

def __init__(self, bus: FourWire, **kwargs) -> None:
def __init__(self, bus: Union[FourWire, I2CDisplayBus], **kwargs) -> None:
init_sequence = bytearray(_INIT_SEQUENCE)
super().__init__(
bus,
Expand Down