Skip to content

Commit 34bcf3c

Browse files
committed
formating
1 parent c7dc901 commit 34bcf3c

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

adafruit_led_animation/animation/blink.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,15 @@ class Blink(ColorCycle):
3737
:param pixel_object: The initialised LED object.
3838
:param float speed: Animation speed in seconds, e.g. ``0.1``.
3939
:param color: Animation color in ``(r, g, b)`` tuple, or ``0x000000`` hex format.
40-
:param background_color: Background color in ``(r, g, b)`` tuple, or ``0x000000`` hex format. Defaults to BLACK.
40+
:param background_color: Background color in ``(r, g, b)`` tuple, or ``0x000000``
41+
hex format. Defaults to BLACK.
4142
:param name: A human-readable name for the Animation. Used by the string function.
4243
"""
4344

44-
def __init__(
45-
self, pixel_object, speed, color, background_color=BLACK, name=None
46-
):
45+
# pylint: disable=too-many-arguments
46+
def __init__(self, pixel_object, speed, color, background_color=BLACK, name=None):
4747
self._background_color = background_color
48-
super().__init__(
49-
pixel_object, speed, [color, background_color], name=name
50-
)
48+
super().__init__(pixel_object, speed, [color, background_color], name=name)
5149

5250
def _set_color(self, color):
5351
self.colors = [color, self._background_color]

adafruit_led_animation/animation/volume.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ class Volume(Animation):
4444

4545
# pylint: disable=too-many-arguments
4646
def __init__(
47-
self, pixel_object, speed, brightest_color, decoder, max_volume=500, name=None
47+
self,
48+
pixel_object,
49+
speed,
50+
brightest_color,
51+
decoder,
52+
max_volume=500,
53+
name=None,
4854
):
4955
self._decoder = decoder
5056
self._num_pixels = len(pixel_object)
@@ -89,8 +95,15 @@ def draw(self):
8995
)
9096

9197
lit_pixels = int(
92-
map_range(self._decoder.rms_level, 0, self._max_volume, 0, self._num_pixels)
98+
map_range(
99+
self._decoder.rms_level,
100+
0,
101+
self._max_volume,
102+
0,
103+
self._num_pixels,
104+
)
93105
)
106+
# pylint: disable=consider-using-min-builtin
94107
if lit_pixels > self._num_pixels:
95108
lit_pixels = self._num_pixels
96109

adafruit_led_animation/sequence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class AnimationSequence:
7373
animations.animate()
7474
"""
7575

76-
# pylint: disable=too-many-instance-attributes
76+
# pylint: disable=too-many-instance-attributes, too-many-arguments
7777
def __init__(
7878
self,
7979
*members,

examples/led_animation_blink_with_background.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
# Update to match the number of NeoPixels you have connected
2222
pixel_num = 30
2323

24-
pixels = neopixel.NeoPixel(
25-
pixel_pin, pixel_num, brightness=0.5, auto_write=False
26-
)
24+
pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.5, auto_write=False)
2725

2826
blink = Blink(pixels, speed=0.5, color=PURPLE, background_color=YELLOW)
2927

0 commit comments

Comments
 (0)