Browse Source

sanitize sensor values

main
Hendrik Langer 7 years ago
parent
commit
0a8a918d1b
  1. 22
      src/main.cpp

22
src/main.cpp

@ -227,15 +227,19 @@ void ICACHE_FLASH_ATTR sendValues() {
root["radioactivity"] = sd.radioactivity; root["radioactivity"] = sd.radioactivity;
} }
JsonObject& voltageObject = array.createNestedObject(); if (sd.voltage > 2.5 ) {
voltageObject["sensor"] = SENSOR7_ID; JsonObject& voltageObject = array.createNestedObject();
voltageObject["value"] = sd.voltage; voltageObject["sensor"] = SENSOR7_ID;
root["voltage"] = sd.voltage; voltageObject["value"] = sd.voltage;
root["voltage"] = sd.voltage;
JsonObject& rssiObject = array.createNestedObject(); }
rssiObject["sensor"] = SENSOR8_ID;
rssiObject["value"] = sd.rssi; if (sd.rssi != 0) {
root["rssi"] = sd.rssi; JsonObject& rssiObject = array.createNestedObject();
rssiObject["sensor"] = SENSOR8_ID;
rssiObject["value"] = sd.rssi;
root["rssi"] = sd.rssi;
}
root["millis"] = millis(); root["millis"] = millis();
root["heap"] = ESP.getFreeHeap(); root["heap"] = ESP.getFreeHeap();

Loading…
Cancel
Save