def rename_friendly_name(attributes):
    """
    Given the attributes to be stored, replace the friendly name. Helpful
    if names changed during the course of history and you want to quickly
    correct the naming.
    """
    rename_table = {
        "Old Sensor Name": "New Sensor Name",
    }

    if "friendly_name" in attributes and attributes["friendly_name"] in rename_table:
        # print("renaming %s to %s" % (attributes["friendly_name"], rename_table[attributes["friendly_name"]]))
        attributes["friendly_name"] = rename_table[attributes["friendly_name"]]

    return attributes