diff --git a/Arduino/CanGrow/CanGrow_WebFunctions.h b/Arduino/CanGrow/CanGrow_WebFunctions.h index 816dd09..4efbb8f 100644 --- a/Arduino/CanGrow/CanGrow_WebFunctions.h +++ b/Arduino/CanGrow/CanGrow_WebFunctions.h @@ -1017,21 +1017,20 @@ void APIgetDebug() { JsonObject objSensors = jsonDebug["sensors"].add(); // Chirp - JsonObject objSensorsChirp = jsonDebug["sensors"]["chirp"].add(); - objSensorsChirp["temperature"] = getTemperature(2); - objSensorsChirp["soilmoisture"] = getSoilmoisture(2); - objSensorsChirp["light"] = getLightchirp(); + objSensors["chirp"]["temperature"] = getTemperature(2); + objSensors["chirp"]["soilmoisture"] = getSoilmoisture(2); + objSensors["chirp"]["light"] = getLightchirp(); // DHT11/22 - JsonObject objSensorsDht = jsonDebug["sensors"]["dht"].add(); - objSensorsDht["temperature"] = getTemperature(1); - objSensorsDht["humidity"] = getHumidity(); + objSensors["dht"]["temperature"] = getTemperature(1); + objSensors["dht"]["humidity"] = getHumidity(); // Analog - JsonObject objSensorsAnalog = jsonDebug["sensors"]["analog"].add(); - objSensorsAnalog["soilmoisture"] = getSoilmoisture(1); - objSensorsAnalog["waterlevel"] = getWaterlevel(); + objSensors["analog"]["soilmoisture"] = getSoilmoisture(1); + objSensors["analog"]["waterlevel"] = getWaterlevel(); + String body; + serializeJsonPretty(jsonDebug, body); webserver.send(200, "text/json", body);