Do:
    Class Command:
        UP = 1
        DOWN = ...

Then you can use 'Command.UP' instead of 'COMMANDS['UP']'

Also spell it out. 'Left' is more clear and easier to read than 'LF', which is more "pythonic".