OctoPrintClient.control

OctoPrintClient.control.getCustomControls(opts)

Retrieves the defined custom controls from the server.

Arguments
  • opts (object()) – Additional options for the request

Returns Promise

A jQuery Promise for the request’s response

OctoPrintClient.control.sendGcode(commands, opts)

Sends the provided commands to the printer.

Corresponds to the Send an arbitrary command to the printer API, see there for details.

Arguments
  • commands (list or string()) – One or more commands to send to the printer.

  • opts (object()) – Additional options for the request

Returns Promise

A jQuery Promise for the request’s response

OctoPrintClient.control.sendGcodeWithParameters(commands, parameters, opts)

Sends the provided commands to the printer, replacing contained placeholders with the provided parameters first.

Corresponds to the Send an arbitrary command to the printer API, see there for details.

Arguments
  • commands (list or string()) – One or more commands to send to the printer

  • parameters (object()) – Parameters (key-value-pairs) to replace placeholders in commands with

  • opts (object()) – Additional options for the request

Returns Promise

A jQuery Promise for the request’s response

OctoPrintClient.control.sendGcodeScript(script, context, opts)

Sends the provided script to the printer, enhancing the template with the specified context.

Arguments
  • script (string()) – Name of the script to send to the printer

  • context (object()) – Template context

  • opts (object()) – Additional options for the request

Returns Promise

A jQuery Promise for the request’s response

OctoPrintClient.control.sendGcodeScriptWithParameters(script, context, parameters, opts)

Sends the provided script to the printer, enhancing the template with the specified context and parameters.

Arguments
  • script (string()) – Name of the script to send to the printer

  • context (object()) – Template context

  • parameters (object()) – Template parameters

  • opts (object()) – Additional options for the request

Returns Promise

A jQuery Promise for the request’s response