more ems+ optimizations

This commit is contained in:
proddy
2019-04-19 17:11:36 +02:00
parent 584192344c
commit 8814c2a504
7 changed files with 171 additions and 90 deletions

View File

@@ -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.");