self.accs = get_objects(['accx', 'accy', 'accz'])
self.mags = get_objects(['magx', 'magy', 'magz'])
- self.touch = get_objects(['touch'])
- self.light = get_objects(['light'])
+ self.lgts = get_objects(['lgt'])
+ self.tchs = get_objects(['tch'])
self.a2ds = get_objects(['a2d0', 'a2d1', 'a2d2', 'a2d3', 'a2d4', 'a2d5'])
# Signal handlers
name = name.replace('_btn', '')
state = obj.get_active()
if self.config.enable[name] != state:
+ self.device.set_enable(name, state)
self.config.enable[name] = state
- self.device.control()
self.config.save()
def on_rate(self, obj):
name = name.replace('_spin', '')
value = obj.get_value()
if self.config.rate[name] != value:
+ self.device.set_rate(name, value)
self.config.rate[name] = value
- self.device.control()
self.config.save()
def on_config(self, obj):
setxyz(self.accs, state.acc)
setxyz(self.mags, state.mag)
- setabs(self.touch, state.touch)
- setabs(self.light, state.light)
+ setabs(self.lgts, state.lgt)
+ setabs(self.tchs, state.tch)
setabs(self.a2ds, state.a2d)
def debug(self, state):
print('update: ' + str(state))
print('\tacc - ' + str(state.acc))
print('\tmag - ' + str(state.mag))
- print('\tlgt - ' + str(state.light))
- print('\ttch - ' + str(state.touch))
+ print('\tlgt - ' + str(state.lgt))
+ print('\ttch - ' + str(state.tch))
print('\ta2d - ' + str(state.a2d))
def timer(self):