@Override(ConcurrentExperiment)
    @logged("info")
    def do_send_command_to_device(self, lab_session_id, command):
        """
        Callback run when the client sends a command to the experiment
        @param command Command sent by the client, as a string.
        """
        if self.debug:
            print "[Aquarium*] do_send_command_to_device called: %s" % command

        if command == 'get-status':
            return json.dumps(self._status.get_status())
        elif command.startswith('ball:'):
            try:
                _, ball, on = command.split(':')
            except:
                traceback.print_exc()
                return "ERROR:Invalid ball command"

            if not ball.lower() in COLORS:
                return "ERROR:Invalid ball color"

            if not on.lower() in ('true','false'):
                return "ERROR:Invalid state"

            on   = on.lower() == 'true'
            ball = ball.lower()
            
            self._status.move(ball, on)

            return json.dumps(self._status.get_status())
        elif command == 'process':
            return json.dumps(self.proxy.process_image())

        return 'ERROR:Invalid command'
dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/experiments/aquarium.py/Aquarium.do_send_command_to_device/original