mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +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
|
// 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>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user