mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
show message to restart after setting params
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user