changeset 470:68e1655eaa2c

fix bcf2000 valueOut when you pass an int 0,1 to a button
author drewp@bigasterisk.com
date Sun, 16 Nov 2008 04:21:02 +0000
parents c96768581667
children b2c9fc6815d1
files bcf2000.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bcf2000.py	Tue Oct 14 06:34:50 2008 +0000
+++ b/bcf2000.py	Sun Nov 16 04:21:02 2008 +0000
@@ -103,7 +103,7 @@
         self.lastValue[name] = value
         which = [k for k,v in self.control.items() if v == name]
         assert len(which) == 1, "unknown control name %r" % name
-        if isinstance(value, bool):
+        if name.startswith('button-'):
             value = value * 127
         #print "bcf: write %s %s" % (name, value)
         self.dev.write(chr(0xb0) + chr(which[0]) + chr(int(value)))