Skip to content

Commit 3a67501

Browse files
Merge pull request #2 from tannewt/update_examples
Tweak examples for new package
2 parents b40b9c4 + d5dee4a commit 3a67501

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ install:
2626
- pip install pylint circuitpython-build-tools
2727

2828
script:
29-
- pylint adafruit_fancyled/*.py --disable=too-many-branches
29+
- pylint adafruit_fancyled/*.py
3030
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py)
3131
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-fancyled --library_location .

adafruit_fancyled/adafruit_fancyled.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class CRGB(object):
6161
"""
6262

6363
def __init__(self, red, green=0.0, blue=0.0):
64+
# pylint: disable=too-many-branches
6465
if isinstance(red, CHSV):
6566
# If first/only argument is a CHSV type, perform HSV to RGB
6667
# conversion.
@@ -90,6 +91,7 @@ def __init__(self, red, green=0.0, blue=0.0):
9091
self.blue = ((b * hsv.saturation) + invsat) * hsv.value
9192
else:
9293
# Red, green, blue arguments (normalized floats OR integers)
94+
# TODO(tannewt): Factor this out into a helper function
9395
if isinstance(red, float):
9496
self.red = clamp(red, 0.0, 1.0)
9597
else:
@@ -323,6 +325,7 @@ def gamma_adjust(val, gamma_value=None, brightness=1.0, inplace=False):
323325
In cases 2 and 3, there is NO return value if 'inplace' is True --
324326
the original values are modified.
325327
"""
328+
# pylint: disable=too-many-branches
326329

327330
if isinstance(val, float):
328331
# Input value appears to be a single float

examples/cpx_helper_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""
33

44
from adafruit_circuitplayground.express import cpx
5-
import fastled_helpers as helper
5+
import adafruit_fancyled.fastled_helpers as helper
66

77
cpx.pixels.auto_write = False # Refresh pixels only when we say
88

examples/cpx_rotate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""
33

44
from adafruit_circuitplayground.express import cpx
5-
import adafruit_fancyled as fancy
5+
import adafruit_fancyled.adafruit_fancyled as fancy
66

77
cpx.pixels.auto_write = False # Refresh pixels only when we say
88
cpx.pixels.brightness = 1.0 # We'll use FancyLED's brightness controls

examples/neopixel_rotate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import board
55
import neopixel
6-
import adafruit_fancyled as fancy
6+
import adafruit_fancyled.adafruit_fancyled as fancy
77

88
num_leds = 20
99

0 commit comments

Comments
 (0)