mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-31 09:27:16 +02:00
Merge pull request #118 from airgradienthq/hotfix/offline-mode-should-not-show-server-status
Offline mode should not show server status on display
This commit is contained in:
@ -402,9 +402,8 @@ static void factoryConfigReset(void) {
|
|||||||
mqttTask = NULL;
|
mqttTask = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Disconnect WIFI */
|
/** Reset WIFI */
|
||||||
wifiConnector.disconnect();
|
WiFi.disconnect(true, true);
|
||||||
wifiConnector.reset();
|
|
||||||
|
|
||||||
/** Reset local config */
|
/** Reset local config */
|
||||||
configuration.reset();
|
configuration.reset();
|
||||||
@ -875,14 +874,17 @@ static void appLedHandler(void) {
|
|||||||
static void appDispHandler(void) {
|
static void appDispHandler(void) {
|
||||||
if (ag->isOne()) {
|
if (ag->isOne()) {
|
||||||
AgStateMachineState state = AgStateMachineNormal;
|
AgStateMachineState state = AgStateMachineNormal;
|
||||||
if (wifiConnector.isConnected() == false) {
|
|
||||||
state = AgStateMachineWiFiLost;
|
|
||||||
} else if (apiClient.isFetchConfigureFailed()) {
|
|
||||||
state = AgStateMachineSensorConfigFailed;
|
|
||||||
} else if (apiClient.isPostToServerFailed()) {
|
|
||||||
state = AgStateMachineServerLost;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/** Only show display status on online mode. */
|
||||||
|
if (configuration.isOfflineMode() == false) {
|
||||||
|
if (wifiConnector.isConnected() == false) {
|
||||||
|
state = AgStateMachineWiFiLost;
|
||||||
|
} else if (apiClient.isFetchConfigureFailed()) {
|
||||||
|
state = AgStateMachineSensorConfigFailed;
|
||||||
|
} else if (apiClient.isPostToServerFailed()) {
|
||||||
|
state = AgStateMachineServerLost;
|
||||||
|
}
|
||||||
|
}
|
||||||
stateMachine.displayHandle(state);
|
stateMachine.displayHandle(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user