Skip to content

Commit 3a6375d

Browse files
committed
Implemented changes requested by @FoamyGuy.
1 parent 95758b3 commit 3a6375d

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

adafruit_epd/epd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from typing import Any, Union, Callable, Optional
1919
from busio import SPI
2020
from digitalio import Direction, DigitalInOut
21-
from PIL.Image import Image
21+
from circuitpython_typing.pil import Image
2222

2323
except ImportError:
2424
pass
@@ -195,7 +195,7 @@ def command(
195195

196196
return ret
197197

198-
def _spi_transfer(self, data: Union[int, bytearray]) -> int:
198+
def _spi_transfer(self, data: Union[int, bytearray]) -> Optional[int]:
199199
"""Transfer one byte or bytearray, toggling the cs pin if required by the EPD chipset"""
200200
if isinstance(data, int): # single byte!
201201
self._spibuf[0] = data

adafruit_epd/il0373.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
try:
1818
"""Needed for type annotations"""
19-
from typing import Union, Any
19+
from typing import Union
2020
from busio import SPI
2121
from digitalio import DigitalInOut
2222

@@ -144,7 +144,7 @@ def update(self) -> None:
144144
if not self._busy:
145145
time.sleep(15) # wait 15 seconds
146146

147-
def write_ram(self, index: Union[0, 1]) -> Any:
147+
def write_ram(self, index: Union[0, 1]) -> int:
148148
"""Send the one byte command for starting the RAM write process. Returns
149149
the byte read at the same time over SPI. index is the RAM buffer, can be
150150
0 or 1 for tri-color displays."""

adafruit_epd/il0398.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
try:
1818
"""Needed for type annotations"""
19-
from typing import Union, Any
19+
from typing import Union
2020
from busio import SPI
2121
from digitalio import DigitalInOut
2222

@@ -144,7 +144,7 @@ def update(self) -> None:
144144
if not self._busy:
145145
time.sleep(15) # wait 15 seconds
146146

147-
def write_ram(self, index: Union[0, 1]) -> Any:
147+
def write_ram(self, index: Union[0, 1]) -> int:
148148
"""Send the one byte command for starting the RAM write process. Returns
149149
the byte read at the same time over SPI. index is the RAM buffer, can be
150150
0 or 1 for tri-color displays."""

adafruit_epd/il91874.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
try:
1818
"Needed for type annotations"
19-
from typing import Union, Any
19+
from typing import Union
2020
from busio import SPI
2121
from digitalio import DigitalInOut
2222

@@ -167,7 +167,7 @@ def update(self) -> None:
167167
if not self._busy:
168168
time.sleep(16) # wait 16 seconds
169169

170-
def write_ram(self, index: Union[0, 1]) -> Any:
170+
def write_ram(self, index: Union[0, 1]) -> int:
171171
"""Send the one byte command for starting the RAM write process. Returns
172172
the byte read at the same time over SPI. index is the RAM buffer, can be
173173
0 or 1 for tri-color displays."""

adafruit_epd/ssd1608.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
try:
1818
"""Needed for type annotations"""
19-
from typing import Union, Any
19+
from typing import Union
2020
from busio import SPI
2121
from digitalio import DigitalInOut
2222

@@ -156,7 +156,7 @@ def update(self) -> None:
156156
if not self._busy:
157157
time.sleep(3) # wait 3 seconds
158158

159-
def write_ram(self, index: Union[0]) -> Any:
159+
def write_ram(self, index: Union[0]) -> int:
160160
"""Send the one byte command for starting the RAM write process. Returns
161161
the byte read at the same time over SPI. index is the RAM buffer, can be
162162
0 or 1 for tri-color displays."""

adafruit_epd/ssd1675.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
try:
1818
"""Needed for type annotations"""
19-
from typing import Union, Any
19+
from typing import Union
2020
from busio import SPI
2121
from digitalio import DigitalInOut
2222

@@ -178,7 +178,7 @@ def update(self) -> None:
178178
if not self._busy:
179179
time.sleep(3) # wait 3 seconds
180180

181-
def write_ram(self, index: Union[0, 1]) -> Any:
181+
def write_ram(self, index: Union[0, 1]) -> int:
182182
"""Send the one byte command for starting the RAM write process. Returns
183183
the byte read at the same time over SPI. index is the RAM buffer, can be
184184
0 or 1 for tri-color displays."""

adafruit_epd/ssd1675b.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
try:
1818
"""Needed for type annotations"""
19-
from typing import Union, Any
19+
from typing import Union
2020
from busio import SPI
2121
from digitalio import DigitalInOut
2222

@@ -220,7 +220,7 @@ def update(self) -> None:
220220
if not self._busy:
221221
time.sleep(3) # wait 3 seconds
222222

223-
def write_ram(self, index: Union[0, 1]) -> Any:
223+
def write_ram(self, index: Union[0, 1]) -> int:
224224
"""Send the one byte command for starting the RAM write process. Returns
225225
the byte read at the same time over SPI. index is the RAM buffer, can be
226226
0 or 1 for tri-color displays."""

adafruit_epd/ssd1680.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
try:
1818
"""Needed for type annotations"""
19-
from typing import Union, Any
19+
from typing import Union
2020
from busio import SPI
2121
from digitalio import DigitalInOut
2222

@@ -191,7 +191,7 @@ def update(self) -> None:
191191
if not self._busy:
192192
time.sleep(3) # wait 3 seconds
193193

194-
def write_ram(self, index: Union[0, 1]) -> Any:
194+
def write_ram(self, index: Union[0, 1]) -> int:
195195
"""Send the one byte command for starting the RAM write process. Returns
196196
the byte read at the same time over SPI. index is the RAM buffer, can be
197197
0 or 1 for tri-color displays."""

adafruit_epd/ssd1681.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from adafruit_epd.epd import Adafruit_EPD
1616

1717
try:
18-
from typing import Union, Any
18+
from typing import Union
1919
from busio import SPI
2020
from digitalio import DigitalInOut
2121

@@ -173,7 +173,7 @@ def update(self) -> None:
173173
if not self._busy:
174174
time.sleep(3) # wait 3 seconds
175175

176-
def write_ram(self, index: Union[0, 1]) -> Any:
176+
def write_ram(self, index: Union[0, 1]) -> int:
177177
"""Send the one byte command for starting the RAM write process. Returns
178178
the byte read at the same time over SPI. index is the RAM buffer, can be
179179
0 or 1 for tri-color displays."""

adafruit_epd/uc8151d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
try:
1818
"""Needed for type annotations"""
19-
from typing import Union, Any
19+
from typing import Union
2020
from busio import SPI
2121
from digitalio import DigitalInOut
2222

@@ -152,7 +152,7 @@ def update(self) -> None:
152152
if not self._busy:
153153
time.sleep(15) # wait 15 seconds
154154

155-
def write_ram(self, index: Union[0, 1]) -> Any:
155+
def write_ram(self, index: Union[0, 1]) -> int:
156156
"""Send the one byte command for starting the RAM write process. Returns
157157
the byte read at the same time over SPI. index is the RAM buffer, can be
158158
0 or 1 for tri-color displays."""

0 commit comments

Comments
 (0)