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

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