@staticmethod
def get_preset_dictionary(root, rule_id):
    """Get the presets from a rule based on rule ID and returns a dictionary with all the key-value pairs."""
    preset_dictionary = {}
    directives = root.find("rule[@id='" + rule_id + "']/directives")
    for directive in directives:
        preset_dictionary[directive.attrib['preset']] = float(directive.
            find('then').attrib['setpoint'])
    return preset_dictionary
