diff --git a/printermonitor/printermonitor.ino b/printermonitor/printermonitor.ino index f240c02..37b381e 100644 --- a/printermonitor/printermonitor.ino +++ b/printermonitor/printermonitor.ino @@ -629,40 +629,47 @@ void displayPrinterStatus() { html += "
";
+ html += "Host Name: " + OctoPrintHostName + "
";
if (printerClient.getError() != "") {
html += "Error: " + printerClient.getError() + "
";
}
html += "Status: " + printerClient.getState() + "
";
- html += "File: " + printerClient.getFileName() + "
";
- float fileSize = printerClient.getFileSize().toFloat();
- if (fileSize > 0) {
- fileSize = fileSize / 1024;
- html += "File Size: " + String(fileSize) + "KB
";
- }
- int filamentLength = printerClient.getFilamentLength().toInt();
- if (filamentLength > 0) {
- float fLength = float(filamentLength) / 1000;
- html += "Filament: " + String(fLength) + "m
";
- }
- html += "Tool Temperature: " + printerClient.getTempToolActual() + "° C
";
- html += "Bed Temperature: " + printerClient.getTempBedActual() + "° C
";
+ if (printerClient.isPrinting()) {
+ html += "File: " + printerClient.getFileName() + "
";
+ float fileSize = printerClient.getFileSize().toFloat();
+ if (fileSize > 0) {
+ fileSize = fileSize / 1024;
+ html += "File Size: " + String(fileSize) + "KB
";
+ }
+ int filamentLength = printerClient.getFilamentLength().toInt();
+ if (filamentLength > 0) {
+ float fLength = float(filamentLength) / 1000;
+ html += "Filament: " + String(fLength) + "m
";
+ }
- int val = printerClient.getProgressPrintTimeLeft().toInt();
- int days = elapsedDays(val);
- int hours = numberOfHours(val);
- int minutes = numberOfMinutes(val);
- int seconds = numberOfSeconds(val);
- html += "Est. Print Time Left: " + zeroPad(hours) + ":" + zeroPad(minutes) + ":" + zeroPad(seconds) + "
";
+ html += "Tool Temperature: " + printerClient.getTempToolActual() + "° C
";
+ html += "Bed Temperature: " + printerClient.getTempBedActual() + "° C
";
+
+ int val = printerClient.getProgressPrintTimeLeft().toInt();
+ int days = elapsedDays(val);
+ int hours = numberOfHours(val);
+ int minutes = numberOfMinutes(val);
+ int seconds = numberOfSeconds(val);
+ html += "Est. Print Time Left: " + zeroPad(hours) + ":" + zeroPad(minutes) + ":" + zeroPad(seconds) + "
";
+
+ val = printerClient.getProgressPrintTime().toInt();
+ days = elapsedDays(val);
+ hours = numberOfHours(val);
+ minutes = numberOfMinutes(val);
+ seconds = numberOfSeconds(val);
+ html += "Printing Time: " + zeroPad(hours) + ":" + zeroPad(minutes) + ":" + zeroPad(seconds) + "
";
+ html += "";
+ html += "