rjwats
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
7 deletions
-
lib/framework/OTASettingsService.cpp
-
lib/framework/OTASettingsService.h
|
|
@ -25,14 +25,9 @@ void OTASettingsService::onConfigUpdated() { |
|
|
|
} |
|
|
|
|
|
|
|
void OTASettingsService::readFromJsonObject(JsonObject& root) { |
|
|
|
_enabled = root["enabled"]; |
|
|
|
_port = root["port"]; |
|
|
|
_enabled = root["enabled"] | DEFAULT_OTA_ENABLED; |
|
|
|
_port = root["port"] | DEFAULT_OTA_PORT; |
|
|
|
_password = root["password"] | DEFAULT_OTA_PASSWORD; |
|
|
|
|
|
|
|
// provide defaults
|
|
|
|
if (_port < 0) { |
|
|
|
_port = DEFAULT_OTA_PORT; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void OTASettingsService::writeToJsonObject(JsonObject& root) { |
|
|
|
|
|
@ -15,6 +15,7 @@ |
|
|
|
// Emergency defaults |
|
|
|
#define DEFAULT_OTA_PORT 8266 |
|
|
|
#define DEFAULT_OTA_PASSWORD "esp-react" |
|
|
|
#define DEFAULT_OTA_ENABLED true |
|
|
|
|
|
|
|
#define OTA_SETTINGS_FILE "/config/otaSettings.json" |
|
|
|
#define OTA_SETTINGS_SERVICE_PATH "/rest/otaSettings" |
|
|
|