mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
edit script to react on command
This commit is contained in:
1 parent
e14a0edb3c
commit
b5d48be64a
4 files changed
+36
No files matched your search
@@ -199,6 +199,7 @@ void loadDataFromWeb() {
|
||||
//configuration setup
|
||||
String hostName = jsonContent["device"]["hostname"];
|
||||
String requestState = jsonContent["state"];
|
||||
String command = jsonContent["command"];
|
||||
if (!buttonActive) {
|
||||
state = (int)jsonContent["value"];
|
||||
Serial.println("state: " + (String)state);
|
||||
@@ -208,6 +209,14 @@ void loadDataFromWeb() {
|
||||
delay(500);
|
||||
}
|
||||
|
||||
if (command == "reset"){
|
||||
ESP.reset();
|
||||
} else if (command == "config") {
|
||||
CleanEeprom();
|
||||
EEPROM.commit();
|
||||
ESP.restart();
|
||||
}
|
||||
|
||||
if (requestState != "succes") {
|
||||
unsuccessfulRounds++;
|
||||
Serial.println("UNSUCCESSFUL ROUND NUMBER " + String(unsuccessfulRounds) + "FROM 5");
|
||||
|
||||
Reference in new issue
Block a user