File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -25,14 +25,9 @@ void OTASettingsService::onConfigUpdated() {
25
25
}
26
26
27
27
void OTASettingsService::readFromJsonObject (JsonObject& root) {
28
- _enabled = root[" enabled" ];
29
- _port = root[" port" ];
28
+ _enabled = root[" enabled" ] | DEFAULT_OTA_ENABLED ;
29
+ _port = root[" port" ] | DEFAULT_OTA_PORT ;
30
30
_password = root[" password" ] | DEFAULT_OTA_PASSWORD;
31
-
32
- // provide defaults
33
- if (_port < 0 ) {
34
- _port = DEFAULT_OTA_PORT;
35
- }
36
31
}
37
32
38
33
void OTASettingsService::writeToJsonObject (JsonObject& root) {
Original file line number Diff line number Diff line change 15
15
// Emergency defaults
16
16
#define DEFAULT_OTA_PORT 8266
17
17
#define DEFAULT_OTA_PASSWORD " esp-react"
18
+ #define DEFAULT_OTA_ENABLED true
18
19
19
20
#define OTA_SETTINGS_FILE " /config/otaSettings.json"
20
21
#define OTA_SETTINGS_SERVICE_PATH " /rest/otaSettings"
You can’t perform that action at this time.
0 commit comments