Change error status on display to icon

This commit is contained in:
samuelbles07
2025-03-24 03:52:46 +07:00
parent ea5e23b307
commit ef87cde9d6
5 changed files with 133 additions and 57 deletions

View File

@ -34,6 +34,7 @@ CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License
#include "AgValue.h"
#include "AgWiFiConnector.h"
#include "AirGradient.h"
#include "App/AppDef.h"
#include "Arduino.h"
#include "EEPROM.h"
#include "ESPmDNS.h"
@ -1111,12 +1112,21 @@ static void updateDisplayAndLedBar(void) {
return;
}
if (wifiConnector.isConnected() == false && networkOption == UseWifi) {
stateMachine.displayHandle(AgStateMachineWiFiLost);
stateMachine.handleLeds(AgStateMachineWiFiLost);
return;
if (networkOption == UseWifi) {
if (wifiConnector.isConnected() == false) {
stateMachine.displayHandle(AgStateMachineWiFiLost);
stateMachine.handleLeds(AgStateMachineWiFiLost);
return;
}
}
else if (networkOption == UseCellular) {
if (agClient->isClientReady() == false) {
// Same action as wifi
stateMachine.displayHandle(AgStateMachineWiFiLost);
stateMachine.handleLeds(AgStateMachineWiFiLost);
return;
}
}
// TODO: Also show for cellular connection problem
if (configuration.isCloudConnectionDisabled()) {
// Ignore API related check since cloud is disabled