better handling of backend not being reachable
This commit is contained in:
parent
f9a6c4fec2
commit
4602b4a35b
1 changed files with 8 additions and 6 deletions
14
src/main.cpp
14
src/main.cpp
|
@ -334,13 +334,15 @@ void handleData1Interrupt() {
|
|||
// Process the response
|
||||
DynamicJsonDocument json = httpClient.decodeJsonResponse(response);
|
||||
|
||||
bool DisableDoor = json["enabled"].as<bool>();
|
||||
settings.setDisableDoor(!DisableDoor);
|
||||
if (json.containsKey("enabled")) {
|
||||
bool DisableDoor = json["enabled"].as<bool>();
|
||||
settings.setDisableDoor(!DisableDoor);
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println("JSON Reader Enabled: " + json["enabled"].as<String>());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println("JSON Reader Enabled: " + json["enabled"].as<String>());
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue