mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-14 12:17:11 +01:00
Merged in eldonb/espurna/ERB-Add-Mqtt-DateTime (pull request #40)
Added 'datetime' to Mqtt Heartbeat Report Approved-by: Xose Pérez <xose.perez@gmail.com>
This commit is contained in:
@@ -120,6 +120,7 @@
|
||||
#define HEARTBEAT_REPORT_MAC 1
|
||||
#define HEARTBEAT_REPORT_RSSI 1
|
||||
#define HEARTBEAT_REPORT_UPTIME 1
|
||||
#define HEARTBEAT_REPORT_DATETIME 1
|
||||
#define HEARTBEAT_REPORT_FREEHEAP 1
|
||||
#define HEARTBEAT_REPORT_VCC 1
|
||||
#define HEARTBEAT_REPORT_RELAY 1
|
||||
@@ -431,6 +432,7 @@ PROGMEM const char* const custom_reset_string[] = {
|
||||
#define MQTT_TOPIC_IP "ip"
|
||||
#define MQTT_TOPIC_VERSION "version"
|
||||
#define MQTT_TOPIC_UPTIME "uptime"
|
||||
#define MQTT_TOPIC_DATETIME "datetime"
|
||||
#define MQTT_TOPIC_FREEHEAP "freeheap"
|
||||
#define MQTT_TOPIC_VCC "vcc"
|
||||
#define MQTT_TOPIC_STATUS "status"
|
||||
|
||||
@@ -118,6 +118,9 @@ void heartbeat() {
|
||||
#if (HEARTBEAT_REPORT_UPTIME)
|
||||
mqttSend(MQTT_TOPIC_UPTIME, String(uptime_seconds).c_str());
|
||||
#endif
|
||||
#if (HEARTBEAT_REPORT_DATETIME) & (NTP_SUPPORT)
|
||||
mqttSend(MQTT_TOPIC_DATETIME, String(ntpDateTime()).c_str());
|
||||
#endif
|
||||
#if (HEARTBEAT_REPORT_FREEHEAP)
|
||||
mqttSend(MQTT_TOPIC_FREEHEAP, String(free_heap).c_str());
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user