From faa14c80581a866f0ef38e80628605875ef983b9 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Mon, 20 Nov 2023 13:29:00 +0000 Subject: [PATCH] QA: Apply ruff suggestions. --- inky/eeprom.py | 4 ++-- inky/inky_ac073tc1a.py | 2 +- inky/inky_uc8159.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inky/eeprom.py b/inky/eeprom.py index 4c07cdc9..ba926783 100644 --- a/inky/eeprom.py +++ b/inky/eeprom.py @@ -44,7 +44,7 @@ def __init__(self, width, height, color, pcb_variant, display_variant, write_tim self.width = width self.height = height self.color = color - if type(color) == str: + if isinstance(color, str): self.set_color(color) self.pcb_variant = pcb_variant self.display_variant = display_variant @@ -87,7 +87,7 @@ def encode(self): def to_list(self): """Return a list of bytes representing the EEPROM data structure.""" result = self.encode() - if type(result) is bytes: + if isinstance(result, bytes): return result return [ord(c) for c in self.encode()] diff --git a/inky/inky_ac073tc1a.py b/inky/inky_ac073tc1a.py index c0eade3c..03528a7f 100644 --- a/inky/inky_ac073tc1a.py +++ b/inky/inky_ac073tc1a.py @@ -388,7 +388,7 @@ def _spi_write(self, dc, values): self._gpio.output(self.cs_pin, 0) self._gpio.output(self.dc_pin, dc) - if type(values) is str: + if isinstance(values, str): values = [ord(c) for c in values] for byte_value in values: diff --git a/inky/inky_uc8159.py b/inky/inky_uc8159.py index 0decc8be..eeec8376 100644 --- a/inky/inky_uc8159.py +++ b/inky/inky_uc8159.py @@ -425,7 +425,7 @@ def _spi_write(self, dc, values): self._gpio.output(self.cs_pin, 0) self._gpio.output(self.dc_pin, dc) - if type(values) is str: + if isinstance(values, str): values = [ord(c) for c in values] try: