Mercurial > code > home > repos > homeauto
changeset 1234:c02ac623e593
animated rgb puts more data back into graph
Ignore-this: d3ba1aa218aa1782aa715d5cd013bb9
darcs-hash:c4b0603e41006cb77224ee3adc7e79d1e3a6a6d6
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sun, 07 Apr 2019 03:58:05 -0700 |
parents | 5d97ed6118db |
children | d8aa414f21d9 |
files | lib/devices_shared.py |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/devices_shared.py Sun Apr 07 03:57:56 2019 -0700 +++ b/lib/devices_shared.py Sun Apr 07 03:58:05 2019 -0700 @@ -67,6 +67,7 @@ self.x = AnimChannel(0) self.y = AnimChannel(0) self.height = AnimChannel(numLeds) + self.src = "" def animateTo(self, x, y, height, src, rate=30, interpolate=ROOM['slide']): log.info('anim to %s x=%s y=%s h=%s', src, x, y, height) @@ -87,7 +88,13 @@ log.debug('current = %r', self.current) def currentStatements(self): - return [] + return [ + (self.uri, RDF.type, ROOM['ScanGroup']), + (self.uri, ROOM['xValue'], Literal(self.x.get())), + (self.uri, ROOM['yValue'], Literal(self.y.get())), + (self.uri, ROOM['heightValue'], Literal(self.height.get())), + (self.uri, ROOM['src'], Literal(self.src)), + ] def colorForIndex(self, i): return list(self.current[i,:]) @@ -132,7 +139,9 @@ return ( [(self.uri, ROOM['pixelGroup'], grp) for grp in self.groups.keys()] + sum([v[2].currentStatements() - for v in self.groups.itervalues()], [])) + for v in self.groups.itervalues()], []) + + [] # current + ) def getColorOrder(self, graph, uri): colorOrder = graph.value(uri, ROOM['colorOrder'], @@ -148,7 +157,6 @@ self.updateOutput() def onStatements(self, statements, _groups=True): - needSetup = False animateCalls = {} # group uri : kw for animateTo for s, p, o in statements: