Merge branch 'develop' into hotfix/correct-ota-update-message-on-display

This commit is contained in:
Phat Nguyen authored and GitHub committed 2024-05-24 13:30:09 +07:00
commit 65e759fb90
5 files changed
+31 -7

No files matched your search

+17
View File
@@ -69,11 +69,17 @@ bool AgApiClient::fetchServerConfiguration(void) {
if (retCode != 200) {
client.end();
getConfigFailed = true;
/** Return code 400 mean device not setup on cloud. */
if (retCode == 400) {
notAvailableOnDashboard = true;
}
return false;
}
/** clear failed */
getConfigFailed = false;
notAvailableOnDashboard = false;
/** Get response string */
String respContent = client.getString();
@@ -144,6 +150,17 @@ bool AgApiClient::isFetchConfigureFailed(void) { return getConfigFailed; }
*/
bool AgApiClient::isPostToServerFailed(void) { return postToServerFailed; }
/**
* @brief Get status device has available on dashboard or not. should get after
* fetch configuration return failed
*
* @return true
* @return false
*/
bool AgApiClient::isNotAvailableOnDashboard(void) {
return notAvailableOnDashboard;
}
void AgApiClient::setAirGradient(AirGradient *ag) { this->ag = ag; }
/**
+2
View File
@@ -23,6 +23,7 @@ private:
bool getConfigFailed;
bool postToServerFailed;
bool notAvailableOnDashboard = false; // Device not setup on Airgradient cloud dashboard.
public:
AgApiClient(Stream &stream, Configuration &config);
@@ -33,6 +34,7 @@ public:
bool postToServer(String data);
bool isFetchConfigureFailed(void);
bool isPostToServerFailed(void);
bool isNotAvailableOnDashboard(void);
void setAirGradient(AirGradient *ag);
bool sendPing(int rssi, int bootCount);
};
-1
View File
@@ -628,7 +628,6 @@ bool Configuration::parse(String data, bool isLocal) {
saveConfig();
printConfig();
} else {
logInfo("Update ignored due to local unofficial changes");
if (ledBarTestRequested || co2CalibrationRequested) {
udpated = true;
}
+1 -1
View File
@@ -173,7 +173,7 @@ String Measurements::toString(bool localServer, AgFirmwareMode fwMode, int rssi,
root["noxRaw"] = this->NOxRaw;
}
}
root["bootCount"] = bootCount;
root["boot"] = bootCount;
if (localServer) {
root["ledMode"] = config->getLedBarModeName();