# HG changeset patch # User drewp@bigasterisk.com # Date 2015-06-13 06:28:30 # Node ID da8a4696227f31018293c0e7b8df0f681eb73631 # Parent 7817e1ef0ff03b262bd7d0776f1252d4b91f2f80 make the rgb strip work more like the neo ones Ignore-this: e272be49d61373e188f7da5de19c273b diff --git a/light9/Effects.py b/light9/Effects.py --- a/light9/Effects.py +++ b/light9/Effects.py @@ -18,7 +18,7 @@ def register(f): @register class Strip(object): """list of r,g,b tuples for sending to an LED strip""" - which = 'L' # LR means both + which = 'L' # LR means both. W is the wide one pixels = [] @classmethod def solid(cls, which='L', color=(1,1,1), hsv=None): diff --git a/light9/effecteval/effectloop.py b/light9/effecteval/effectloop.py --- a/light9/effecteval/effectloop.py +++ b/light9/effecteval/effectloop.py @@ -226,7 +226,7 @@ class LedLoop(EffectLoop): def combineOutputs(self, outputs): combined = {'L': Z, 'R': Z, 'blacklight0': 0, 'blacklight1': 0, - 'rgb': numpy.zeros((1, 3), dtype=numpy.float16)} + 'W': numpy.zeros((1, 3), dtype=numpy.float16)} for out in outputs: log.debug('combine output %r', out) @@ -236,7 +236,8 @@ class LedLoop(EffectLoop): elif isinstance(out, Effects.Strip): pixels = numpy.array(out.pixels, dtype=numpy.float16) for w in out.which: - combined[w] = numpy.maximum(combined[w], pixels) + combined[w] = numpy.maximum( + combined[w], pixels[:1,:] if w == 'W' else pixels) return combined @@ -247,7 +248,7 @@ class LedLoop(EffectLoop): ('setStrip', (1,), combined['R']), ('setUv', (0,), combined['blacklight0']), ('setUv', (1,), combined['blacklight1']), - ('setRgb', (), combined['rgb']), + ('setRgb', (), combined['W']), ]: key = (meth, selectArgs) compValue = value.tolist() if isinstance(value, numpy.ndarray) else value