def parseDeviceInfo(device_info):
    """
    Parses Vendor, Product, Revision and UID from a Setup API entry
    :param device_info: string of device information to parse
    :return: dictionary of parsed information or original string if error
    """
    # Initialize variables
    vid = ''
    pid = ''
    rev = ''
    uid = ''

    # Split string into segments on \\
    segments = device_info[0].split('\\')

    if 'usb' not in segments[0].lower():
        return None  # Eliminate non-USB devices from output. may hide othe rstorage devices

    for item in segments[1].split('&'):
        lower_item = item.lower()
        if 'ven' in lower_item or 'vid' in lower_item:
            vid = item.split('_',1)[-1]
        elif 'dev' in lower_item or 'pid' in lower_item or 'prod' in lower_item:
            pid = item.split('_',1)[-1]
        elif 'rev' in lower_item or 'mi' in lower_item:
            rev = item.split('_',1)[-1]

    if len(segments) >= 3:
        uid = segments[2].strip(']')

    if vid != '' or pid != '':
        return {'Vendor ID': vid.lower(), 'Product ID': pid.lower(),
                'Revision': rev, 'UID': uid,
                'First Installation Date': device_info[1]}
    else:
        # Unable to parse data, returning whole string
        return device_info