show configuration via HTTP
This commit is contained in:
parent
220ed8c10c
commit
bde1b9b36f
16
things.ino
16
things.ino
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user