diff --git a/src/Output.h b/src/Output.h index 0ddcc94..e9c4aba 100644 --- a/src/Output.h +++ b/src/Output.h @@ -30,7 +30,7 @@ protected: void _write(const bool state) { if (state != get()) { if (logState) { - Serial.printf("%s: %s\n", name.c_str(), state ? "ON" : "OFF"); + Serial.printf("[RELAY] \"%s\" = %s\n", name.c_str(), state ? "ON" : "OFF"); } stateMillis = millis(); } diff --git a/src/config.cpp b/src/config.cpp index 7e392c7..7f2e380 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -60,7 +60,7 @@ void doLog(const String &path, const String &value, const bool isPassword, const "[CONFIG] %-20s = %-30s [%s]\n", path.c_str(), isPassword ? "*" : value.c_str(), - type == CONFIG_LOG_FALLBACK ? "FALLBACK" : type == CONFIG_LOG_READ ? "READ" : type == CONFIG_LOG_UNCHANGED ? "UNCHANGED" : type == CONFIG_LOG_WRITE ? "WRITE" : "" + type == CONFIG_LOG_FALLBACK ? "fallback" : type == CONFIG_LOG_READ ? "READ" : type == CONFIG_LOG_UNCHANGED ? "UNCHANGED" : type == CONFIG_LOG_WRITE ? "WRITE" : "" ); } diff --git a/src/http.cpp b/src/http.cpp index 8595eaa..fef9206 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -29,10 +29,8 @@ void httpRelay(const int index, Output &relay) { if (server.hasArg(stateKey)) { const auto state = server.arg(stateKey); if (state == "true") { - Serial.printf("[HTTP] %s = %s\n", stateKey.c_str(), state.c_str()); relay.set(true); } else if (state == "false") { - Serial.printf("[HTTP] %s = %s\n", stateKey.c_str(), state.c_str()); relay.set(false); } } @@ -41,13 +39,10 @@ void httpRelay(const int index, Output &relay) { if (server.hasArg(initialKey)) { const auto initial = server.arg(initialKey); if (initial == "OFF") { - Serial.printf("[HTTP] %s = %s\n", initialKey.c_str(), initial.c_str()); relay.setInitial(INITIAL_OFF); } else if (initial == "ON") { - Serial.printf("[HTTP] %s = %s\n", initialKey.c_str(), initial.c_str()); relay.setInitial(INITIAL_ON); } else if (initial == "CYCLE") { - Serial.printf("[HTTP] %s = %s\n", initialKey.c_str(), initial.c_str()); relay.setInitial(INITIAL_CYCLE); } } @@ -55,21 +50,18 @@ void httpRelay(const int index, Output &relay) { const auto onCountKey = String("onCount") + index; if (server.hasArg(onCountKey)) { const auto value = server.arg(onCountKey).toInt(); - Serial.printf("[HTTP] %s = %ld\n", onCountKey.c_str(), value); relay.setOnCount(value); } const auto onMillisKey = String("onMillis") + index; if (server.hasArg(onMillisKey)) { const auto value = server.arg(onMillisKey).toInt(); - Serial.printf("[HTTP] %s = %ld\n", onMillisKey.c_str(), value); relay.setOnMillis(value); } const auto offMillisKey = String("offMillis") + index; if (server.hasArg(offMillisKey)) { const auto value = server.arg(offMillisKey).toInt(); - Serial.printf("[HTTP] %s = %ld\n", offMillisKey.c_str(), value); relay.setOffMillis(value); } }