31
31
32
32
import displayio
33
33
34
+ try :
35
+ from typing import Union
36
+ except ImportError :
37
+ pass
38
+
34
39
__version__ = "0.0.0+auto.0"
35
40
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306.git"
36
41
@@ -62,7 +67,9 @@ class SSD1306(displayio.Display):
62
67
(0, 90, 180, 270)
63
68
"""
64
69
65
- def __init__ (self , bus , ** kwargs ):
70
+ def __init__ (
71
+ self , bus : Union [displayio .Fourwire , displayio .I2CDisplay ], ** kwargs
72
+ ) -> None :
66
73
# Patch the init sequence for 32 pixel high displays.
67
74
init_sequence = bytearray (_INIT_SEQUENCE )
68
75
height = kwargs ["height" ]
@@ -87,7 +94,7 @@ def __init__(self, bus, **kwargs):
87
94
self ._is_awake = True # Display starts in active state (_INIT_SEQUENCE)
88
95
89
96
@property
90
- def is_awake (self ):
97
+ def is_awake (self ) -> bool :
91
98
"""
92
99
The power state of the display. (read-only)
93
100
@@ -97,7 +104,7 @@ def is_awake(self):
97
104
"""
98
105
return self ._is_awake
99
106
100
- def sleep (self ):
107
+ def sleep (self ) -> None :
101
108
"""
102
109
Put display into sleep mode.
103
110
@@ -108,7 +115,7 @@ def sleep(self):
108
115
self .bus .send (0xAE , b"" ) # 0xAE = display off, sleep mode
109
116
self ._is_awake = False
110
117
111
- def wake (self ):
118
+ def wake (self ) -> None :
112
119
"""
113
120
Wake display from sleep mode
114
121
"""
0 commit comments