Skip to content
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

Error when setting pixel value to a list value (circuitpython 4.0.0beta) #39

Closed
cpforbes opened this issue Jan 30, 2019 · 3 comments
Closed

Comments

@cpforbes
Copy link
Contributor

When setting a pixel with a list for the value:

>>> import board
>>> import neopixel
>>> NUMPIXELS = 16
>>> neopixels = neopixel.NeoPixel(board.D4, NUMPIXELS, brightness=0.2, auto_write=False)
>>> neopixels[1] = [0,0,0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "neopixel.py", line 169, in __setitem__
  File "neopixel.py", line 148, in _set_item
TypeError: unsupported types for __add__: 'list', 'tuple'

This appears to be from the tuple addition used here:

r, g, b, w = value if len(value) == 4 else value+(0,)

@cpforbes cpforbes changed the title CError when setting pixel value to a list value (circuitpython 4.0.0beta) Error when setting pixel value to a list value (circuitpython 4.0.0beta) Jan 30, 2019
@tannewt
Copy link
Member

tannewt commented Feb 4, 2019

@cpforbes Want to try fixing it? I can help if you have any questions.

@cpforbes
Copy link
Contributor Author

cpforbes commented Feb 4, 2019

@tannewt Sure. Will work on a PR.

@tannewt
Copy link
Member

tannewt commented Feb 5, 2019

Great! Thank you. Will review it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants