mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
remove date/time from log, its already in the log
This commit is contained in:
@@ -106,18 +106,19 @@ void Shower::loop() {
|
||||
|
||||
// duration in seconds
|
||||
doc["duration"] = duration_; // seconds
|
||||
time_t now = time(nullptr);
|
||||
// if NTP enabled, publish timestamp
|
||||
if (now > 1576800000) { // year 2020
|
||||
// doc["timestamp_s"] = now; // if needed, in seconds
|
||||
tm * tm_ = localtime(&now);
|
||||
char dt[25];
|
||||
strftime(dt, sizeof(dt), "%FT%T%z", tm_);
|
||||
doc["timestamp"] = dt;
|
||||
LOG_INFO("shower finished %s (duration %lu s)", dt, duration_);
|
||||
} else {
|
||||
LOG_INFO("shower finished (duration %lu s)", duration_);
|
||||
}
|
||||
// time_t now = time(nullptr);
|
||||
// // if NTP enabled, publish timestamp
|
||||
// if (now > 1576800000) { // year 2020
|
||||
// // doc["timestamp_s"] = now; // if needed, in seconds
|
||||
// tm * tm_ = localtime(&now);
|
||||
// char dt[25];
|
||||
// strftime(dt, sizeof(dt), "%FT%T%z", tm_);
|
||||
// doc["timestamp"] = dt;
|
||||
// LOG_INFO("Shower finished %s (duration %lus)", dt, duration_);
|
||||
// } else {
|
||||
// LOG_INFO("Shower finished (duration %lus)", duration_);
|
||||
// }
|
||||
LOG_INFO("Shower finished (duration %lus)", duration_);
|
||||
Mqtt::queue_publish("shower_data", doc.as<JsonObject>());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user