diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-23 15:22:54 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-23 15:22:54 +0200 |
commit | 568c82ac54a308fa92e805572ca998fc9d7fb902 (patch) | |
tree | 69232a6ae23c49da04f3a66ca4685581db4c1171 | |
parent | 376ab64059e9e676e121310ba094c7a8d732397a (diff) | |
download | Luxcena-cs-568c82ac54a308fa92e805572ca998fc9d7fb902.tar.gz Luxcena-cs-568c82ac54a308fa92e805572ca998fc9d7fb902.zip |
Added dynamic success message when saving settings
-rw-r--r-- | IOT-clapSensor.ino | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/IOT-clapSensor.ino b/IOT-clapSensor.ino index a6f236e..e6f0048 100644 --- a/IOT-clapSensor.ino +++ b/IOT-clapSensor.ino @@ -204,7 +204,7 @@ void handleJson() { } void handleSettings() { - + String successMsg = ""; String type, _deviceName, _deviceLocation, _ssid, _password; for (int i = 0; i < server.args(); i++) { String argKey = server.argName(i); @@ -232,12 +232,13 @@ void handleSettings() { MemoryAccess.writeAscii("Password", _password); } MemoryAccess.commit(); + successMsg = "Settings updated!"; while (1); } String htmlResponse = SETTINGS_page; htmlResponse.replace("{{NAME}}", deviceName); - htmlResponse.replace("{{SUCCESSMSG}}", ""); + htmlResponse.replace("{{SUCCESSMSG}}", successMsg); htmlResponse.replace("{{DEVICENAME}}", deviceName); htmlResponse.replace("{{DEVICELOCATION}}", deviceLocation); server.send( 200, "text/html", htmlResponse ); |