print config in a more useful way

This commit is contained in:
Ronald Schaten 2016-03-22 00:37:37 +01:00
parent bde1b9b36f
commit 89ac7b2dc9

View File

@ -421,12 +421,14 @@ void setup() {
read_sensor();
DynamicJsonBuffer jsonBuffer;
JsonObject& json = jsonBuffer.createObject();
json["mqtt_server"] = mqtt_server;
json["mqtt_port"] = mqtt_port;
json["mqtt_topic"] = mqtt_topic;
json["capability_dht"] = capability_dht;
json["capability_ldr"] = capability_ldr;
json["capability_rgb"] = capability_rgb;
JsonObject& mqtt = json.createNestedObject("mqtt");
mqtt["server"] = mqtt_server;
mqtt["port"] = mqtt_port;
mqtt["topic"] = mqtt_topic;
JsonObject& capability = json.createNestedObject("capability");
capability["dht"] = capability_dht;
capability["ldr"] = capability_ldr;
capability["rgb"] = capability_rgb;
String response;
json.printTo(response);
http_server.send(200, "text/plain", response);