Skip to content

Commit 6d5085c

Browse files
committed
lint
1 parent 1d4f729 commit 6d5085c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

neopixel.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# imports needed for main NeoPixel class
3535
import digitalio
3636
from neopixel_write import neopixel_write
37-
except:
37+
except ModuleNotFoundError:
3838
# silently accept this, can still use NeoPixel SPI class
3939
pass
4040

@@ -259,18 +259,18 @@ class NeoPixel_SPI(NeoPixel):
259259
pixels = neopixel.NeoPixel_SPI(board.SPI(), 10)
260260
pixels.fill(0xff0000)
261261
"""
262-
#pylint: disable=invalid-name
262+
#pylint: disable=invalid-name, super-init-not-called
263263

264264
FREQ = 6400000 # 800kHz * 8, actual may be different
265265
TRST = 80e-6 # Reset code low level time
266266

267267
def __init__(self, spi, n, *, bpp=3, brightness=1.0, auto_write=True, pixel_order=None):
268268
from adafruit_bus_device.spi_device import SPIDevice
269269
self._spi = SPIDevice(spi, baudrate=self.FREQ)
270-
with self._spi as spi:
270+
with self._spi as spibus:
271271
try:
272272
# get actual SPI frequency
273-
freq = spi.frequency
273+
freq = spibus.frequency
274274
except AttributeError:
275275
# use nominal
276276
freq = self.FREQ
@@ -313,4 +313,4 @@ def _transmogrify(self, buf):
313313
out_buf.append(0b11110000) # A NeoPixel 1 bit
314314
else:
315315
out_buf.append(0b11000000) # A NeoPixel 0 bit
316-
return out_buf
316+
return out_buf

0 commit comments

Comments
 (0)