printer 3d remaining: set default text

This commit is contained in:
Ranlvor 2018-09-02 11:35:43 +02:00
parent 1752ab93e0
commit 8469803c6e
Signed by untrusted user who does not match committer: Ranlvor
GPG key ID: 5E12D04750EF6F8E

View file

@ -151,14 +151,14 @@ const config: Config = {
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 "unavailable";
} 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);
} }
} }
}, },
defaultValue: "" defaultValue: "unavailable"
}, },
nebenraumPowerStatus: { nebenraumPowerStatus: {
state: { state: {