def get_factor(units, unit_id):
    """
    Returns the factor of a Unit-Config
    """
    if not units:
        return None

    for unit in units:
        if unit.id == unit_id:
            if unit.to_base_function:
                return unit.to_base_function
            return unit.factor