]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blobdiff - displayio/_i2cdisplay.py
Merge pull request #83 from tekktrik/dev/switch-typing-module
[hackapet/Adafruit_Blinka_Displayio.git] / displayio / _i2cdisplay.py
index 63e4af6fa82e327f5d75ddb421d402ece1cd15f8..958ce1d97433d12391806aef701d56892f536acb 100644 (file)
@@ -23,7 +23,7 @@ displayio for Blinka
 import time
 import busio
 import digitalio
-import _typing
+import circuitpython_typing
 from ._constants import CHIP_SELECT_UNTOUCHED, DISPLAY_COMMAND
 
 __version__ = "0.0.0-auto.0"
@@ -76,7 +76,7 @@ class I2CDisplay:
         while not self._i2c.try_lock():
             pass
 
-    def send(self, command: int, data: _typing.ReadableBuffer) -> None:
+    def send(self, command: int, data: circuitpython_typing.ReadableBuffer) -> None:
         """
         Sends the given command value followed by the full set of data. Display state,
         such as vertical scroll, set via ``send`` may or may not be reset once the code is
@@ -86,8 +86,13 @@ class I2CDisplay:
         self._send(DISPLAY_COMMAND, CHIP_SELECT_UNTOUCHED, bytes([command] + data))
         self._end_transaction()
 
-    # pylint: disable=unused-argument
-    def _send(self, data_type: int, chip_select: int, data: _typing.ReadableBuffer):
+    def _send(
+        self,
+        data_type: int,
+        chip_select: int,
+        data: circuitpython_typing.ReadableBuffer,
+    ):
+        # pylint: disable=unused-argument
         if data_type == DISPLAY_COMMAND:
             n = len(data)
             if n > 0:
@@ -103,8 +108,6 @@ class I2CDisplay:
             data_bytes[1:] = data
             self._i2c.writeto(self._dev_addr, buffer=data_bytes, stop=True)
 
-    # pylint: enable=unused-argument
-
     def _end_transaction(self) -> None:
         """Release the bus after sending data."""
         self._i2c.unlock()