; all the things
This commit is contained in:
parent
16ac2f0a40
commit
1752ab93e0
1 changed files with 3 additions and 3 deletions
|
|
@ -149,11 +149,11 @@ const config: Config = {
|
||||||
state: {
|
state: {
|
||||||
name: "/service/ultimaker/job",
|
name: "/service/ultimaker/job",
|
||||||
type: (msg) => {
|
type: (msg) => {
|
||||||
const json = JSON.parse(msg.toString())
|
const json = JSON.parse(msg.toString());
|
||||||
if(!json || !json["time_elapsed"] || !json["time_total"]) {
|
if(!json || !json["time_elapsed"] || !json["time_total"]) {
|
||||||
return ""
|
return "";
|
||||||
} else {
|
} else {
|
||||||
const secondsLeft = json["time_total"] - json["time_elapsed"]
|
const secondsLeft = json["time_total"] - json["time_elapsed"];
|
||||||
return new Date(secondsLeft * 1000).toISOString().substr(11, 8);
|
return new Date(secondsLeft * 1000).toISOString().substr(11, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue