diff options
author | Dan <dan@rcoh-ubuntu-small.(none)> | 2011-01-28 10:11:22 -0500 |
---|---|---|
committer | Dan <dan@rcoh-ubuntu-small.(none)> | 2011-01-28 10:11:22 -0500 |
commit | a028c880c8325419a238667e71a7e919b72a4798 (patch) | |
tree | 5a07f674fcead141165a5b4fec0143c3e6c60e05 /behaviors/MobileShakeBehavior.py | |
parent | b8bb5e82a2e8802b9adb1258463d4198f974dbd1 (diff) | |
parent | 3319a58ecc391f9aac092ade45f9f50dc2af5aa6 (diff) |
Merge branch 'fridaydemo' of github.com:rcoh/SmootLight into osc
Diffstat (limited to 'behaviors/MobileShakeBehavior.py')
-rw-r--r-- | behaviors/MobileShakeBehavior.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/behaviors/MobileShakeBehavior.py b/behaviors/MobileShakeBehavior.py new file mode 100644 index 0000000..e25e929 --- /dev/null +++ b/behaviors/MobileShakeBehavior.py @@ -0,0 +1,17 @@ +from operationscore.Behavior import * +import util.Strings as Strings + +class MobileShakeBehavior(Behavior): + def processResponse(self, sensorInputs, recursiveInputs): + #print sensorInputs + ret = [] + for sInput in sensorInputs: + outDict = dict(sInput) + if 'type' in sInput and sInput['type'] == 2: + outDict['Location'] = '{x}>' + str(0) + ',{y}>' + str(0) + outDict['Color'] = [sInput['r'], sInput['g'], sInput['b']] + else: # dumb invisible pixel + outDict['Location'] = (-1, -1) + outDict['Color'] = [0, 0, 0] + ret.append(outDict) + return (ret, recursiveInputs) |