def dtc_converter(result):
    """
    Converts Diagnostics Trouble Codes (DTCs) result into a cloud friendly format.
    """

    if result.get("_type", None) != "get_dtc":
        raise Exception("Unable to convert as DTC result: {:}".format(result))

    result["_type"] = "dtc"
    result["values"] = [{"code": r[0], "text": r[1]} for r in result.pop("value", None) or []]

    return result