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() {
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue