Commit b93aaaa6 authored by Leon Tappe's avatar Leon Tappe 🔥
Browse files

adjust toner levels to make more practical sense

parent 01bd37e3
......@@ -165,8 +165,8 @@ class PrinterStatus {
Level _percentageToLevel(int percentage) {
if (percentage >= 90) return Level.full;
if (percentage >= 25) return Level.mid;
if (percentage > 0) return Level.low;
if (percentage >= 30) return Level.mid;
if (percentage > 10) return Level.low;
return Level.empty;
}
}
......@@ -308,22 +308,22 @@ class PrintersBloc extends Bloc<PrintersEvent, PrintersState> {
if (printer.status.tonerC > 100) {
printer.status.tonerC = 100;
} else if (printer.status.tonerC < 0) {
printer.status.tonerC = 0;
printer.status.tonerC = 10;
}
if (printer.status.tonerM > 100) {
printer.status.tonerM = 100;
} else if (printer.status.tonerM < 0) {
printer.status.tonerM = 0;
printer.status.tonerM = 10;
}
if (printer.status.tonerY > 100) {
printer.status.tonerY = 100;
} else if (printer.status.tonerY < 0) {
printer.status.tonerY = 0;
printer.status.tonerY = 10;
}
if (printer.status.tonerK > 100) {
printer.status.tonerK = 100;
} else if (printer.status.tonerK < 0) {
printer.status.tonerK = 0;
printer.status.tonerK = 10;
}
// catch paper levels under 0 to make calculations work properly
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment