This commit is contained in:
Proddy
2023-01-30 20:21:28 +01:00
parent e2f149caf9
commit 6dc63907f1
2 changed files with 16 additions and 7 deletions

View File

@@ -601,10 +601,7 @@ bool System::heartbeat_json(JsonObject & output) {
output["uptime"] = uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3);
output["uptime_sec"] = uuid::get_uptime_sec();
bool value_b = ntp_connected();
if (Mqtt::ha_enabled()) {
char s[12];
output["ntp_status"] = Helpers::render_boolean(s, value_b); // for HA always render as string
} else if (EMSESP::system_.bool_format() == BOOL_FORMAT_TRUEFALSE) {
if (EMSESP::system_.bool_format() == BOOL_FORMAT_TRUEFALSE) {
output["ntp_status"] = value_b;
} else if (EMSESP::system_.bool_format() == BOOL_FORMAT_10) {
output["ntp_status"] = value_b ? 1 : 0;