round real value with 2 decimal on server sync data json

This commit is contained in:
Phat Nguyen
2024-02-17 12:47:51 +07:00
parent 7c63af5ba9
commit 8c94cea764
5 changed files with 30 additions and 22 deletions

View File

@ -122,8 +122,8 @@ public:
/** Call handler */
handler();
Serial.printf("[AgSchedule] handle 0x%08x, period: %d(ms)\r\n",
(unsigned int)handler, period);
// Serial.printf("[AgSchedule] handle 0x%08x, period: %d(ms)\r\n",
// (unsigned int)handler, period);
/** Update period time */
count = millis();
@ -648,9 +648,7 @@ static void co2Poll(void) {
Serial.printf("CO2 index: %d\r\n", co2Ppm);
}
static void showNr(void) {
Serial.println("Serial nr: " + getDevId());
}
static void showNr(void) { Serial.println("Serial nr: " + getDevId()); }
static void sendPing() {
JSONVar root;
@ -1500,7 +1498,7 @@ static void sendDataToServer(void) {
root["noxIndex"] = noxIndex;
}
if (temp >= 0) {
root["atmp"] = temp;
root["atmp"] = ag.round2(temp);
}
if (hum >= 0) {
root["rhum"] = hum;