- fix order for ws28xx

This commit is contained in:
Andrey Viktorov
2021-03-24 08:09:09 +03:00
parent 9e73191a91
commit 124ef36564
5 changed files with 30 additions and 19 deletions

View File

@@ -117,3 +117,8 @@ class PriorityLock(asyncio.Lock):
fut.set_result(True)
def map_reorder_rgb(rgb: list, from_: str, to_: str):
if from_ == to_:
return rgb
mapping = [from_.index(x) for x in to_]
return [rgb[x] for x in mapping]