Skip to content

Tweak examples for new package #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ install:
- pip install pylint circuitpython-build-tools

script:
- pylint adafruit_fancyled/*.py --disable=too-many-branches
- pylint adafruit_fancyled/*.py
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py)
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-fancyled --library_location .
3 changes: 3 additions & 0 deletions adafruit_fancyled/adafruit_fancyled.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class CRGB(object):
"""

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

if isinstance(val, float):
# Input value appears to be a single float
Expand Down
2 changes: 1 addition & 1 deletion examples/cpx_helper_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""

from adafruit_circuitplayground.express import cpx
import fastled_helpers as helper
import adafruit_fancyled.fastled_helpers as helper

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

Expand Down
2 changes: 1 addition & 1 deletion examples/cpx_rotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""

from adafruit_circuitplayground.express import cpx
import adafruit_fancyled as fancy
import adafruit_fancyled.adafruit_fancyled as fancy

cpx.pixels.auto_write = False # Refresh pixels only when we say
cpx.pixels.brightness = 1.0 # We'll use FancyLED's brightness controls
Expand Down
2 changes: 1 addition & 1 deletion examples/neopixel_rotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import board
import neopixel
import adafruit_fancyled as fancy
import adafruit_fancyled.adafruit_fancyled as fancy

num_leds = 20

Expand Down