show configuration via HTTP

This commit is contained in:
Ronald Schaten 2016-03-22 00:31:36 +01:00
parent 220ed8c10c
commit bde1b9b36f

View File

@ -417,6 +417,22 @@ void setup() {
delay(100);
});
http_server.on("/config", [](){
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;
String response;
json.printTo(response);
http_server.send(200, "text/plain", response);
delay(100);
});
// start the web server
http_server.begin();
Serial.println("HTTP server started");