0
0
mirror of https://github.com/Doodle3D/Doodle3D-API synced 2024-06-26 13:51:23 +02:00
Doodle3D-API/src/api/printer.js
casperlamboo 2e3b174d3b clean up
code is in single line
2016-07-20 10:16:53 +02:00

29 lines
711 B
JavaScript

import * as rest from '../rest.js';
export default class Printer {
constructor(api) {
this.api = api;
}
temperature() {
return rest.get(`${ this.api }printer/temperature`);
}
progress() {
return rest.get(`${ this.api }printer/progress`);
}
state() {
return rest.get(`${ this.api }printer/state`);
}
listAll() {
return rest.get(`${ this.api }printer/listall`);
}
heatup() {
return rest.post(`${ this.api }printer/heatup`, {});
}
print(gcode = '', first = false, start = false, last) {
return rest.post(`${ this.api }printer/print`, { gcode, first, start, last });
}
stop(gcode = '') {
return rest.post(`${ this.api }printer/stop`, { gcode });
}
}