def _callback(self, cmd, arg=None):
# update pins
if cmd == StateMachine.CMD_PINS:
- self.old_pins = self.pins
self.pins = arg
# handle stuff
newstate = self.current_state.handle_event(cmd,arg) # returns None or an instance of the new state
+ self.old_pins = self.pins # FIXME not used?
while newstate is not None:
logger.info("StateMachine: new state = %s" % newstate.__class__.__name__)
self.current_state = newstate