Merge pull request #129 from airgradienthq/hotfix/turn-led-off-on-offlinemode

Turn LED indicate wifi failed, cloud failed and get cloud configuration failed to off
This commit is contained in:
AirGradient
2024-05-16 11:54:00 +07:00
committed by GitHub

View File

@ -874,6 +874,7 @@ static void configUpdateHandle() {
static void appLedHandler(void) { static void appLedHandler(void) {
AgStateMachineState state = AgStateMachineNormal; AgStateMachineState state = AgStateMachineNormal;
if (configuration.isOfflineMode() == false) {
if (wifiConnector.isConnected() == false) { if (wifiConnector.isConnected() == false) {
state = AgStateMachineWiFiLost; state = AgStateMachineWiFiLost;
} else if (apiClient.isFetchConfigureFailed()) { } else if (apiClient.isFetchConfigureFailed()) {
@ -882,6 +883,7 @@ static void appLedHandler(void) {
} else if (apiClient.isPostToServerFailed()) { } else if (apiClient.isPostToServerFailed()) {
state = AgStateMachineServerLost; state = AgStateMachineServerLost;
} }
}
stateMachine.handleLeds(state); stateMachine.handleLeds(state);
} }