 
     case new_device_cert do
       {:ok, data} ->
+        # DO NOT DO THIS. The api will do it behind the scenes
+        # Asset.update_device!(%{update_channel: detect_update_channel()})
         FarmbotCore.Logger.debug(3, "DeviceCert created: #{inspect(data)}")
         FarmbotCore.Logger.debug(3, "Waiting for cert and key data from AMQP from farmbot api...")
         {:noreply, state}

  end

  def handle_call({:handle_nerves_hub_update_available, _data}, _from, state) do
    FarmbotCore.Logger.success(1, "Applying OTA update")
    {:reply, :apply, %{state | is_applying_update: true}}
  end


    FarmbotCore.Logger.debug(3, "Connected to NervesHub AMQP channel. Fetching certs.")
    old_device_cert = Asset.get_device_cert(serial_number: serial_number())

    tags = detect_deployment_tags()

    params = %{
      serial_number: serial_number(),
