From d99a58676ae281da955f16a2971d23f1487a2c5e Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Thu, 22 Mar 2018 01:25:18 +0300 Subject: [PATCH] Add 'board' to the MQTT heartbeat --- code/espurna/config/general.h | 2 ++ code/espurna/utils.ino | 3 +++ 2 files changed, 5 insertions(+) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 1fbe933d..d631234c 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -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" diff --git a/code/espurna/utils.ino b/code/espurna/utils.ino index 9f0e8e0f..bef49c81 100644 --- a/code/espurna/utils.ino +++ b/code/espurna/utils.ino @@ -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