Added simple effect system

This commit is contained in:
2015-08-28 19:43:07 +02:00
committed by Giovanni Harting
parent 4ad8b85019
commit 43c956c61d
5 changed files with 112 additions and 5 deletions

23
ledd/effectstack.py Normal file
View File

@@ -0,0 +1,23 @@
import asyncio
from ledd.effects.fadeeffect import FadeEffect
class EffectStack(object):
def __init__(self):
self.stripes = []
self.effect = FadeEffect()
# TODO
self.modifiers = []
def start(self):
asyncio.get_event_loop().call_soon(self.execute)
def execute(self):
color = self.effect.execute_internal()
for stripe in self.stripes:
stripe.set_color(color)
# schedule next execution
asyncio.get_event_loop().call_later(0.1, self.execute)