3131
3232import displayio
3333
34+ try :
35+ from typing import Union
36+ except ImportError :
37+ pass
38+
3439__version__ = "0.0.0+auto.0"
3540__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306.git"
3641
@@ -62,7 +67,9 @@ class SSD1306(displayio.Display):
6267 (0, 90, 180, 270)
6368 """
6469
65- def __init__ (self , bus , ** kwargs ):
70+ def __init__ (
71+ self , bus : Union [displayio .Fourwire , displayio .I2CDisplay ], ** kwargs
72+ ) -> None :
6673 # Patch the init sequence for 32 pixel high displays.
6774 init_sequence = bytearray (_INIT_SEQUENCE )
6875 height = kwargs ["height" ]
@@ -87,7 +94,7 @@ def __init__(self, bus, **kwargs):
8794 self ._is_awake = True # Display starts in active state (_INIT_SEQUENCE)
8895
8996 @property
90- def is_awake (self ):
97+ def is_awake (self ) -> bool :
9198 """
9299 The power state of the display. (read-only)
93100
@@ -97,7 +104,7 @@ def is_awake(self):
97104 """
98105 return self ._is_awake
99106
100- def sleep (self ):
107+ def sleep (self ) -> None :
101108 """
102109 Put display into sleep mode.
103110
@@ -108,7 +115,7 @@ def sleep(self):
108115 self .bus .send (0xAE , b"" ) # 0xAE = display off, sleep mode
109116 self ._is_awake = False
110117
111- def wake (self ):
118+ def wake (self ) -> None :
112119 """
113120 Wake display from sleep mode
114121 """
0 commit comments