def calc_av_heat_pump_eff_ey(technologies, heat_pump_assump):
    """Calculate end year average efficiency of
    heat pumps depending on split of heat pumps

    Arguments
    ---------
    technologies : dict
        Technologies
    heat_pump_assump : dict
        Ditionary with split of heat pumps for every fueltype

    Return
    ------
    technologies : dict
        Updated technologies
    """
    for fueltype, heat_pump_split in heat_pump_assump.items():
        av_eff_hps_ey = 0
        for heat_pump_type, share_heat_pump in heat_pump_split.items():
            eff_heat_pump_ey = technologies[heat_pump_type].eff_ey
            av_eff_hps_ey += share_heat_pump * eff_heat_pump_ey
        name_av_hp = 'heat_pumps_{}'.format(fueltype)
        technologies[name_av_hp].eff_ey = av_eff_hps_ey
    return technologies
