Merge pull request #706 from mcspr/mqtt-heartbeat-board

Add 'board' to the MQTT heartbeat
This commit is contained in:
Xose Pérez
2018-03-22 10:44:45 +01:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@@ -181,6 +181,7 @@
#define HEARTBEAT_REPORT_HOSTNAME 1
#define HEARTBEAT_REPORT_APP 1
#define HEARTBEAT_REPORT_VERSION 1
#define HEARTBEAT_REPORT_BOARD 1
#define HEARTBEAT_REPORT_INTERVAL 0
//------------------------------------------------------------------------------
@@ -617,6 +618,7 @@ PROGMEM const char* const custom_reset_string[] = {
#define MQTT_TOPIC_UARTIN "uartin"
#define MQTT_TOPIC_UARTOUT "uartout"
#define MQTT_TOPIC_LOADAVG "loadavg"
#define MQTT_TOPIC_BOARD "board"
// Light module
#define MQTT_TOPIC_CHANNEL "channel"

View File

@@ -137,6 +137,9 @@ void heartbeat() {
#if (HEARTBEAT_REPORT_VERSION)
mqttSend(MQTT_TOPIC_VERSION, APP_VERSION);
#endif
#if (HEARTBEAT_REPORT_BOARD)
mqttSend(MQTT_TOPIC_BOARD, getBoardName().c_str());
#endif
#if (HEARTBEAT_REPORT_HOSTNAME)
mqttSend(MQTT_TOPIC_HOSTNAME, getSetting("hostname").c_str());
#endif