firmware wip - let /api/sensors only return configured sensor values. If you need everything else, use debug
This commit is contained in:
parent
d90dfe346d
commit
2b3eac57a2
1 changed files with 5 additions and 9 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue