mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
more ems+ optimizations
This commit is contained in:
@@ -929,6 +929,17 @@ void _showerColdShotStart() {
|
||||
}
|
||||
}
|
||||
|
||||
// run tests to validate handling of telegrams by injecting fake telegrams
|
||||
void runUnitTest(uint8_t test_num) {
|
||||
ems_setLogging(EMS_SYS_LOGGING_VERBOSE);
|
||||
publishValuesTimer.detach();
|
||||
systemCheckTimer.detach();
|
||||
regularUpdatesTimer.detach();
|
||||
if (test_num >= 1 && test_num <= 10) {
|
||||
ems_testTelegram(test_num);
|
||||
}
|
||||
}
|
||||
|
||||
// callback for loading/saving settings to the file system (SPIFFS)
|
||||
bool FSCallback(MYESP_FSACTION action, const JsonObject json) {
|
||||
if (action == MYESP_FSACTION_LOAD) {
|
||||
@@ -1331,6 +1342,12 @@ void TelnetCommandCallback(uint8_t wc, const char * commandLine) {
|
||||
ok = true;
|
||||
}
|
||||
|
||||
// test commands
|
||||
if ((strcmp(first_cmd, "test") == 0) && (wc == 2)) {
|
||||
runUnitTest(_readIntNumber());
|
||||
ok = true;
|
||||
}
|
||||
|
||||
// check for invalid command
|
||||
if (!ok) {
|
||||
myDebug("Unknown command. Use ? for help.");
|
||||
|
||||
Reference in New Issue
Block a user