[Sub] Sync recipe templates request

The device should delete all recipes and create new ones based on the recipe templates provided in the request.

Request Topic and Payload

Topic

things5-production/v1/devices/<device-id>/cmd/sync_recipe_templates_req

Payload Representation

{
  "cookbook_sync_log_id": "7dc14fd9-8438-4771-9b13-e98d1a9d8c6e",
  "request_id": "UUID sent in the request",
  "recipe_templates": [
    {
      "name": "Pollo con patate al cuore",
      "description": "Recipe description",
      "index": 1,
      "phases": [
        {
          "dosages": [
            [
              {
                "name": "yeast",
                "quantity": "5.5",
                "metadata": [
                  {
                    "name": "type",
                    "value": "1",
                    "type": "integer"
                  },
                  {
                    "name": "temperature",
                    "value": "20",
                    "type": "integer"
                  }
                ]
              }
            ]
          ],
          "values": [
            {
              "name": "evaporator_fan_speed",
              "value": "4",
              "type": "integer"
            },
            {
              "name": "core_temperature",
              "value": "-5",
              "type": "integer"
            },
            {
              "name": "cell_temperature",
              "value": "-20",
              "type": "integer"
            }
          ]
        },
        {
          "values": [
            {
              "name": "evaporator_fan_speed",
              "value": "2",
              "type": "integer"
            },
            {
              "name": "core_temperature",
              "value": "-5",
              "type": "integer"
            },
            {
              "name": "cell_temperature",
              "value": "-20",
              "type": "integer"
            }
          ]
        },
        {
          "values": [
            {
              "name": "evaporator_fan_speed",
              "value": "1",
              "type": "integer"
            },
            {
              "name": "core_temperature",
              "value": "-5",
              "type": "integer"
            },
            {
              "name": "cell_temperature",
              "value": "-20",
              "type": "integer"
            }
          ]
        },
        {
          "values": [
            {
              "name": "evaporator_fan_speed",
              "value": "0",
              "type": "integer"
            },
            {
              "name": "cell_temperature",
              "value": "-10",
              "type": "integer"
            }
          ]
        }
      ],
      "metadata": [
        {
          "name": "image_path",
          "value": "../images/fish.jpg",
          "type": "string"
        },
        {
          "name": "index_in_list",
          "value": "6",
          "type": "integer"
        }
      ]
    }
  ]
}

Payload Parameters

namedescriptionexample
cookbook_sync_log_idthis id should be sent back with the response
request_idthe request id to be sent back by the device when sending the response
recipe_templatesan array of recipe template

📘

Response has to be sent into the sync recipe templates response: