replace the use of calculate buffer by a constant buffer size for json size

This commit is contained in:
Florian committed 2019-06-29 14:46:24 +02:00
1 parent 618f8d6087
commit 2ee18320be
5 files changed
+5 -10

No files matched your search

+1 -2
View File
@@ -49,8 +49,7 @@ void MeasureTempAndHum(){
trc(F("Failed to read from DHT sensor!"));
}else{
trc(F("Creating DHT buffer"));
const int JSON_MSG_CALC_BUFFER = JSON_OBJECT_SIZE(2);
StaticJsonBuffer<JSON_MSG_CALC_BUFFER> jsonBuffer;
StaticJsonBuffer<JSON_MSG_BUFFER> jsonBuffer;
JsonObject& DHTdata = jsonBuffer.createObject();
if(h != persistedh || dht_always){
DHTdata.set("hum", (float)h);