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 providedparameters
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 printerparameters (
object()
) – Parameters (key-value-pairs) to replace placeholders incommands
withopts (
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 specifiedcontext
.- Arguments:
script (
string()
) – Name of the script to send to the printercontext (
object()
) – Template contextopts (
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 specifiedcontext
andparameters
.- Arguments:
script (
string()
) – Name of the script to send to the printercontext (
object()
) – Template contextparameters (
object()
) – Template parametersopts (
object()
) – Additional options for the request
- Returns Promise:
A jQuery Promise for the request’s response