Fix Remaining time counter

This commit is contained in:
Václav Španinger 2024-12-30 17:48:35 +01:00
parent 830e8f1d34
commit 204f48f596

View File

@ -191,14 +191,14 @@ namespace esphome {
return; return;
} }
//Print Paused // //Print Paused
if(MarlinOutput.find("Printer halted") != std::string::npos) { // if(MarlinOutput.find("Printer halted") != std::string::npos) {
set_printer_state("PAUSED"); // set_printer_state("PAUSED");
//reset string for next line // //reset string for next line
MarlinOutput=""; // MarlinOutput="";
return; // return;
} // }
// //Print Stoped // //Print Stoped
if(MarlinOutput.find("Print Aborted") != std::string::npos) { if(MarlinOutput.find("Print Aborted") != std::string::npos) {
@ -271,7 +271,7 @@ namespace esphome {
*current = round(((d)*24*60*60) + ((h)*60*60) + ((m)*60) + (s)); *current = round(((d)*24*60*60) + ((h)*60*60) + ((m)*60) + (s));
if(progress != 0.0 && progress != 100.0) { if(progress != 0.0 && progress != 100.0) {
*remaining = ((100 * *current) / progress); *remaining = (((100 * *current) / progress) -*current);
} }
return 1; return 1;