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
commandsto 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
commandsto the printer, replacing contained placeholders with the providedparametersfirst.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 incommandswithopts (
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
scriptto 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
scriptto the printer, enhancing the template with the specifiedcontextandparameters.- 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