Skip to content

Commit

Permalink
Merge pull request #10 from makermelissa/master
Browse files Browse the repository at this point in the history
Returns the value in the same order it is set
  • Loading branch information
makermelissa committed Nov 5, 2019
2 parents 8ce2d2d + 97a447c commit 2ed038d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adafruit_ws2801.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ def __getitem__(self, index):
out = []
for in_i in range(*index.indices(self._n)):
out.append(
tuple(self._buf[in_i * 3 + (2 - i)] for i in range(3)))
tuple(self._buf[in_i * 3 + i] for i in range(3)))
return out
if index < 0:
index += len(self)
if index >= self._n or index < 0:
raise IndexError
offset = index * 3
return tuple(self._buf[offset + (2 - i)] for i in range(3))
return tuple(self._buf[offset + i] for i in range(3))

def __len__(self):
return self._n
Expand Down

0 comments on commit 2ed038d

Please sign in to comment.