def _process_automations(center, config):
    """Process automations from config."""
    automations = center.data.setdefault(DATA_AUTOMATIONS, {})
    conf = config[CONF_AUTOMATIONS]
    for block in conf:
        name = block[CONF_NAME]
        _LOGGER.debug("Setting up automation %s", name)
        action_sequence = _get_actions(center, block[CONF_ACTION])
        cond_func = _process_condition(center, block[CONF_CONDITION])
        # use partial to get a function with args to call later
        attach_triggers = partial(_process_trigger, center, block[CONF_TRIGGER])
        automations[name] = Automation(
            center, name, attach_triggers, cond_func, action_sequence
        )