firmware wip - let /api/sensors only return configured sensor values. If you need everything else, use debug

This commit is contained in:
Marcus 2024-05-10 23:40:30 +02:00
parent d90dfe346d
commit 2b3eac57a2

View file

@ -952,14 +952,10 @@ void APIgetSensors() {
JsonDocument jsonSensors;
JsonArray arraySoilmoisture = jsonSensors["soilmoisture"].to<JsonArray>();
arraySoilmoisture.add(getSoilmoisture(1));
arraySoilmoisture.add(getSoilmoisture(2));
JsonArray arrayTemperature = jsonSensors["temperature"].to<JsonArray>();
arrayTemperature.add(getTemperature(1));
arrayTemperature.add(getTemperature(2));
jsonSensors["humidity"] = getHumidity();
jsonSensors["chirpLight"] = getLightchirp();
jsonSensors["soilmoisture"] = valSoilmoisture;
jsonSensors["temperature"] = valTemperature;
jsonSensors["humidity"] = valHumidity;
jsonSensors["waterlevel"] = valWaterlevel;
String body;
serializeJsonPretty(jsonSensors, body);