def get_reactions(service_dir, service_name, service_ver, config):
    reactions_desc = _get_service_file(service_dir, service_name, service_ver,
            'react', config=config)

    jsonschema.validate(reactions_desc, _reaction_schema)

    for reaction in reactions_desc:
        actions = []
        for action in reaction['execute']:
            if '.' not in action:
                actions.append(service_name + '.' + action)
            else:
                actions.append(action)

        when = reaction['when']

        # Prepend service name if relative path
        for i in ['files_modified', 'files_created', 'files']:
            if i in when:
                when[i] = _prepend_service_name(service_name, when[i])

        reaction['execute'] = actions

    return reactions_desc
Return the name of the device if any.
dataset/ETHPy150Open gosquadron/squadron/squadron/service.py/get_reactions--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/tests/common.py/MockToggleDevice.state