@staticmethod
def __get_preset_dictionary_v1(root):
    """
        Get the presets and returns a dictionary with all the key-value pairs.

        Example output: {'away': 17.0, 'home': 20.0, 'vacation': 15.0,
        'no_frost': 10.0, 'asleep': 15.0}.
        """
    preset_dictionary = {}
    directives = root.findall('rule/directives/when/then')
    for directive in directives:
        if directive is not None and 'icon' in directive.keys():
            preset_dictionary[directive.attrib['icon']] = float(directive.
                attrib['temperature'])
    return preset_dictionary
