Skip to content

Commit 4ad5e44

Browse files
committed
Linted
1 parent 6d403f1 commit 4ad5e44

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

adafruit_ra8875/ra8875.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# imports
3030
import time
3131
from digitalio import Direction
32-
import adafruit_bus_device.spi_device as spi_device
32+
from adafruit_bus_device import spi_device
3333
import adafruit_ra8875.registers as reg
3434

3535
try:
@@ -119,9 +119,7 @@ def init(self, start_on=True):
119119
vsync_nondisp = 32
120120
vsync_start = 23
121121
vsync_pw = 2
122-
elif self.width == 480 and (
123-
self.height == 272 or self.height == 128 or self.height == 82
124-
):
122+
elif self.width == 480 and self.height in (272, 128, 82):
125123
pixclk = reg.PCSR_PDATL | reg.PCSR_4CLK
126124
hsync_nondisp = 10
127125
hsync_start = 8
@@ -483,8 +481,7 @@ def txt_size(self, scale):
483481
:param byte scale: The the size to scale the Text to
484482
"""
485483
self._txt_mode()
486-
if scale > 3:
487-
scale = 3
484+
scale = min(scale, 3)
488485
self._write_data((self._read_reg(reg.FNCR1) & ~(0xF)) | (scale << 2) | scale)
489486
self._txt_scale = scale
490487

0 commit comments

Comments
 (0)