firmware wip - Notification about Maintenance Mode on display

This commit is contained in:
Marcus 2024-05-08 18:38:54 +02:00
parent 9e0c5056ae
commit 330b3e7649

View file

@ -1355,67 +1355,78 @@ void displayScreens() {
}
display.setCursor(0,0);
if(MaintenanceMode == true) {
display.drawBitmap(0, 0, bmpCanGrow_Logo, 128, 32, WHITE);
display.display();
display.setCursor(0,32);
display.println("Maintenance mode active");
display.print("Time left: ");
display.print(MaintenanceDuration - ((millis() - MaintenanceStarted) / 1000));
display.println("s");
} else {
// in this switch case the single screens gets defined
switch(ScreenToDisplay) {
case 0:
display.print("Humidity: ");
display.print(valHumidity);
display.println(" %");
display.println("");
display.print("Temperature: ");
display.print(valTemperature);
display.println(" C");
display.println("");
display.print("Moisture: ");
display.print(valSoilmoisture);
display.println(" %");
display.println("");
if(UsePump == true) {
display.print("Pump Waterlvl: ");
switch(valWaterlevel) {
case 0:
display.println("OK");
break;
case 1:
display.println("Warn");
break;
case 2:
display.println("Crit");
break;
switch(ScreenToDisplay) {
case 0:
display.print("Humidity: ");
display.print(valHumidity);
display.println(" %");
display.println("");
display.print("Temperature: ");
display.print(valTemperature);
display.println(" C");
display.println("");
display.print("Moisture: ");
display.print(valSoilmoisture);
display.println(" %");
display.println("");
if(UsePump == true) {
display.print("Pump Waterlvl: ");
switch(valWaterlevel) {
case 0:
display.println("OK");
break;
case 1:
display.println("Warn");
break;
case 2:
display.println("Crit");
break;
}
}
}
break;
case 1:
display.print("LED: ");
display.print(PinLEDPWM * 100 / 255);
display.println(" %");
display.print("State: ");
display.println(digitalRead(PinLED));
display.println("");
display.print("FAN: ");
display.print(PinFANPWM * 100 / 255);
display.println(" %");
display.print("State: ");
display.println(digitalRead(PinFAN));
display.println("");
display.print("Pump state: ");
display.println(digitalRead(PinPUMP));
break;
case 2:
// display Logo
display.drawBitmap(0, 0, bmpCanGrow_Logo, 128, 32, WHITE);
display.display();
display.setCursor(0,32);
display.println(GrowName);
display.print("DoG: ");
display.print(DayOfGrow);
display.print(", ");
display.println(timeClient.getFormattedTime());
display.print("IP: ");
display.println(WiFi.localIP());
break;
break;
case 1:
display.print("LED: ");
display.print(PinLEDPWM * 100 / 255);
display.println(" %");
display.print("State: ");
display.println(digitalRead(PinLED));
display.println("");
display.print("FAN: ");
display.print(PinFANPWM * 100 / 255);
display.println(" %");
display.print("State: ");
display.println(digitalRead(PinFAN));
display.println("");
display.print("Pump state: ");
display.println(digitalRead(PinPUMP));
break;
case 2:
// display Logo
display.drawBitmap(0, 0, bmpCanGrow_Logo, 128, 32, WHITE);
display.display();
display.setCursor(0,32);
display.println(GrowName);
display.print("DoG: ");
display.print(DayOfGrow);
display.print(", ");
display.println(timeClient.getFormattedTime());
display.print("IP: ");
display.println(WiFi.localIP());
break;
}
}
ScreenIterationPassed++;
display.display();