set boottime for RTC (if rtc is set)

This commit is contained in:
MichaelDvP
2026-08-10 10:11:43 +02:00
parent 52486ed5b4
commit 1d9a0b6257
+2 -2
View File
@@ -840,7 +840,7 @@ bool System::loop() {
void System::send_info_mqtt() {
static uint8_t _connection = 0;
uint8_t connection = (EMSESP::network_.ethernet_connected() ? 1 : 0) + (EMSESP::network_.wifi_connected() ? 2 : 0) + (ntp_connected_ ? 4 : 0)
+ (EMSESP::network_.has_ipv6() ? 8 : 0);
+ (EMSESP::network_.has_ipv6() ? 8 : 0);
// check if connection status has changed
if (!Mqtt::connected() || connection == _connection) {
return;
@@ -853,7 +853,7 @@ void System::send_info_mqtt() {
// if NTP is enabled send the boot_time in local time in ISO 8601 format (eg: 2022-11-15 20:46:38)
// https://github.com/emsesp/EMS-ESP32/issues/751
if (ntp_connected_) {
if (time(nullptr) > 1500000000L) {
char time_string[25];
time_t now = time(nullptr) - uuid::get_uptime_sec();
strftime(time_string, 25, "%FT%T%z", localtime(&now));