Mercurial > code > home > repos > homeauto
diff service/arduinoNode/arduinoNode.py @ 335:3010238b94a0
rgb strip animation support in arduinoNode
Ignore-this: 5f50c7b54ce1588243735c43d2cbea0f
author | drewp@bigasterisk.com |
---|---|
date | Sat, 03 Mar 2018 17:55:37 -0800 |
parents | bb80182195c0 |
children | 13b2a61650c1 |
line wrap: on
line diff
--- a/service/arduinoNode/arduinoNode.py Sat Mar 03 17:53:37 2018 -0800 +++ b/service/arduinoNode/arduinoNode.py Sat Mar 03 17:55:37 2018 -0800 @@ -200,6 +200,12 @@ byte = self.ser.read(1) if byte != 'x': raise ValueError("after poll, got %x instead of 'x'" % byte) + for i in self._devs: + if i.wantIdleOutput(): + self.ser.write("\x60" + chr(self._devCommandNum[i.uri])) + i.outputIdle(self.ser.write) + if self.ser.read(1) != 'k': + raise ValueError('no ack after outputIdle') elapsed = time.time() - t1 if elapsed > 1.0: log.warn('poll took %.1f seconds' % elapsed)