show message to restart after setting params

This commit is contained in:
Paul
2020-02-20 00:00:43 +01:00
parent 93dff6493a
commit 4ae18602a2
3 changed files with 49 additions and 35 deletions

View File

@@ -877,9 +877,10 @@ char * MyESP::_telnet_readWord(bool allow_all_chars) {
// wc is word count, number of parameters after the 'set' command
bool MyESP::_changeSetting(uint8_t wc, const char * setting, const char * value) {
bool save_config = false;
bool save_custom_config = false;
bool restart = false;
MYESP_FSACTION_t save_custom_config = MYESP_FSACTION_ERR; // default
// check for our internal commands first
if (strcmp(setting, "erase") == 0) {
_fs_eraseConfig();
@@ -941,13 +942,14 @@ bool MyESP::_changeSetting(uint8_t wc, const char * setting, const char * value)
// finally check for any custom commands
if (_fs_setlist_callback_f) {
save_custom_config = (_fs_setlist_callback_f)(MYESP_FSACTION_SET, wc, setting, value);
restart = (save_custom_config == MYESP_FSACTION_RESTART);
}
}
bool ok = false;
// if we were able to recognize the set command, continue
if ((save_config || save_custom_config)) {
if ((save_config || save_custom_config != MYESP_FSACTION_ERR)) {
// check for 2 params
if (value == nullptr) {
myDebug_P(PSTR("%s has been reset to its default value."), setting);
@@ -963,7 +965,7 @@ bool MyESP::_changeSetting(uint8_t wc, const char * setting, const char * value)
}
// and see if we need to also save for custom config
if (save_custom_config) {
if (save_custom_config != MYESP_FSACTION_ERR) {
ok = _fs_createCustomConfig();
}