Make a list of given component type not inherited from other templates because Zabbix API returns only list of all
    and list of inherited component items so we have to do a difference list.

    :param component: Template component (application, item, etc...)
    :param parent_id: ID of existing template the component is assigned to
    :return List of non-inherited (own) components

def _get_existing_template_c_list(component, parent_id, **kwargs):
    '''
    Make a list of given component type not inherited from other templates because Zabbix API returns only list of all
    and list of inherited component items so we have to do a difference list.

    :param component: Template component (application, item, etc...)
    :param parent_id: ID of existing template the component is assigned to
    :return List of non-inherited (own) components
    '''
    c_def = TEMPLATE_COMPONENT_DEF[component]
    q_params = dict(c_def['output'])
    q_params.update({c_def['qselectpid']: parent_id})

    existing_clist_all = __salt__['zabbix.run_query'](c_def['qtype'] + '.get', q_params, **kwargs)

    # in some cases (e.g. templatescreens) the logic is reversed (even name of the flag is different!)
    if c_def['inherited'] == 'inherited':
        q_params.update({c_def['inherited']: 'true'})
        existing_clist_inherited = __salt__['zabbix.run_query'](c_def['qtype'] + '.get', q_params, **kwargs)
    else:
        existing_clist_inherited = []

    if existing_clist_inherited:
        return [c_all for c_all in existing_clist_all if c_all not in existing_clist_inherited]

    return existing_clist_all