Skip pv screen if no generation

This commit is contained in:
Carsten Schmiemann 2022-11-09 00:08:53 +01:00
parent 091fe5c926
commit 70d53bb2af

View file

@ -499,11 +499,19 @@ void loop() {
display_screen++;
lastScreenChangeTime += DISPLAY_SCREEN_INTERVAL;
if (display_screen == display_last_screen + 1)
{
//If no pv power generated, skip PV charger screen
if (pv_kwh == 0)
{
display_screen = 1;
}
else
{
display_screen = 0;
}
}
}
}
//Rotate screen if BUTTON_ROTATION is pressed
currentButtonRotationState = digitalRead(BUTTON_ROTATION);
@ -511,9 +519,17 @@ void loop() {
{
display_screen++;
if (display_screen == display_last_screen + 1)
{
//If no pv power generated, skip PV charger screen
if (pv_kwh == 0)
{
display_screen = 1;
}
else
{
display_screen = 0;
}
}
lastButtonRotationState = currentButtonRotationState;
}