Skip to content

Commit

Permalink
QA: Apply ruff suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Nov 20, 2023
1 parent 02d64d1 commit e9fadf6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions inky/eeprom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()]

Expand Down
2 changes: 1 addition & 1 deletion inky/inky_ac073tc1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion inky/inky_uc8159.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e9fadf6

Please sign in to comment.