RZL: Add 3D printer

This commit is contained in:
Ranlvor 2018-01-14 16:59:03 +01:00
parent 3c1d1886be
commit 760e337878
Signed by untrusted user who does not match committer: Ranlvor
GPG key ID: 5E12D04750EF6F8E

View file

@ -117,6 +117,33 @@ const config : Config = {
command: "/service/openhab/in/pca301_infoscreen/command",
defaultValue: "OFF",
values: { on: "ON", off: "OFF" }
},
printer_3d_status: {
state: "/service/ultimaker/state",
command: "",
defaultValue: "unavailable",
parseState: msg => {
switch (msg.toString()) {
case "unreachable":
case "booting":
return "unavailable"
case "pausing":
case "paused":
case "resuming":
case "wait_cleanup":
case "maintenance":
return "action_needed"
case "pre_print":
case "post_print":
case "printing":
return "printing"
default:
return msg.toString()
}
},
}
},
controls: {
@ -393,6 +420,31 @@ const config : Config = {
text: "Open Infoscreen"
}
]
},
printer_3d: {
name: "Ultimaker 3",
position: [754, 560],
icon: "printer-3d",
iconColor: ({printer_3d_status}) => {
if(printer_3d_status == "action_needed") {
return "#b3b300";
} else if(printer_3d_status == "printing") {
return "#00ff00";
} else if(printer_3d_status == "idle") {
return "#000000";
} else if(printer_3d_status == "unavailable") {
return "#888888";
} else {
return "#ff0000";
}
},
ui: [
{
type: "link",
link: "http://ultimaker.rzl/",
text: "Open Webinterface"
}
]
}
},
layers: [