Skip to content

Commit 674782f

Browse files
committed
pylint
1 parent 8561bed commit 674782f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adafruit_neopxl8.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def __init__(
109109
brightness=1.0,
110110
auto_write=True,
111111
pixel_order=None,
112-
):
112+
): # pylint: disable=too-many-locals
113113
if n % num_strands:
114114
raise ValueError("Length must be a multiple of num_strands")
115115
if not pixel_order:
@@ -127,20 +127,20 @@ def __init__(
127127
data_len = bpp * n
128128
pack = ">L"
129129
osr = False
130-
n = (8 * data_len) - 1
130+
loop_count = 8 * data_len
131131
else:
132132
data_len = bpp * n * 8 // num_strands
133133
pack = "<L"
134134
osr = True
135-
n = data_len - 1
135+
loop_count = data_len
136136
padding_count = -data_len % 4
137137

138138
self._num_strands = num_strands
139139
self._data = bytearray(8 + data_len + padding_count)
140140
self._data32 = memoryview(self._data).cast("L")
141141
self._pixels = memoryview(self._data)[4 : 4 + data_len]
142-
self._data[:4] = struct.pack(pack, n)
143-
self._data[-4:] = struct.pack(pack, 3840 * 2)
142+
self._data[:4] = struct.pack(pack, loop_count - 1)
143+
self._data[-4:] = struct.pack(pack, 3840)
144144

145145
self._num_strands = num_strands
146146

0 commit comments

Comments
 (0)