remove date/time from log, its already in the log

This commit is contained in:
proddy
2024-09-09 08:41:57 +02:00
parent b57bf51afb
commit be6e189948

View File

@@ -106,18 +106,19 @@ void Shower::loop() {
// duration in seconds // duration in seconds
doc["duration"] = duration_; // seconds doc["duration"] = duration_; // seconds
time_t now = time(nullptr); // time_t now = time(nullptr);
// if NTP enabled, publish timestamp // // if NTP enabled, publish timestamp
if (now > 1576800000) { // year 2020 // if (now > 1576800000) { // year 2020
// doc["timestamp_s"] = now; // if needed, in seconds // // doc["timestamp_s"] = now; // if needed, in seconds
tm * tm_ = localtime(&now); // tm * tm_ = localtime(&now);
char dt[25]; // char dt[25];
strftime(dt, sizeof(dt), "%FT%T%z", tm_); // strftime(dt, sizeof(dt), "%FT%T%z", tm_);
doc["timestamp"] = dt; // doc["timestamp"] = dt;
LOG_INFO("shower finished %s (duration %lu s)", dt, duration_); // LOG_INFO("Shower finished %s (duration %lus)", dt, duration_);
} else { // } else {
LOG_INFO("shower finished (duration %lu s)", duration_); // LOG_INFO("Shower finished (duration %lus)", duration_);
} // }
LOG_INFO("Shower finished (duration %lus)", duration_);
Mqtt::queue_publish("shower_data", doc.as<JsonObject>()); Mqtt::queue_publish("shower_data", doc.as<JsonObject>());
} }
} }