Fix old_pins (though it is not used)
authorRalf Jung <post@ralfj.de>
Thu, 10 Oct 2013 13:23:00 +0000 (15:23 +0200)
committerRalf Jung <post@ralfj.de>
Thu, 10 Oct 2013 13:23:00 +0000 (15:23 +0200)
statemachine.py

index fe926823d140c9e152ccc7dd424c95ed3fcc4c12..1fa66b99b17daed756319635a7a3e1bb8bcda3c3 100644 (file)
@@ -199,10 +199,10 @@ class StateMachine():
        def _callback(self, cmd, arg=None):
                # update pins
                if cmd == StateMachine.CMD_PINS:
        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.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
                while newstate is not None:
                        logger.info("StateMachine: new state = %s" % newstate.__class__.__name__)
                        self.current_state = newstate