mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-13 11:47:29 +01:00
Update uptime, heap in web UI every heartbeat
This commit is contained in:
@@ -120,6 +120,18 @@ void heartbeat() {
|
||||
mqttSend(MQTT_TOPIC_STATUS, MQTT_STATUS_ONLINE, true);
|
||||
#endif
|
||||
|
||||
// Send info to websocket clients
|
||||
{
|
||||
char buffer[200];
|
||||
snprintf_P(
|
||||
buffer,
|
||||
sizeof(buffer) - 1,
|
||||
PSTR("{\"time\": \"%s\", \"uptime\": %lu, \"heap\": %lu}"),
|
||||
ntpDateTime().c_str(), uptime_seconds, free_heap
|
||||
);
|
||||
wsSend(buffer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user