print config in a more useful way
This commit is contained in:
parent
bde1b9b36f
commit
89ac7b2dc9
14
things.ino
14
things.ino
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user