From a072ada7ae147b0ff190f542a7e4394fcb19300a Mon Sep 17 00:00:00 2001 From: Niek van der Maas Date: Thu, 21 Mar 2019 12:40:38 +0100 Subject: [PATCH] Add option to disable relay reporting to MQTT --- code/espurna/config/general.h | 4 ++++ code/espurna/relay.ino | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 8c74394c..c1404d61 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -356,6 +356,10 @@ #define RELAY_SAVE_DELAY 1000 #endif +#ifndef RELAY_REPORT_STATUS +#define RELAY_REPORT_STATUS 1 +#endif + // Configure the MQTT payload for ON/OFF #ifndef RELAY_MQTT_ON #define RELAY_MQTT_ON "1" diff --git a/code/espurna/relay.ino b/code/espurna/relay.ino index 9fb78dc1..2d784d77 100644 --- a/code/espurna/relay.ino +++ b/code/espurna/relay.ino @@ -339,7 +339,7 @@ bool relayStatus(unsigned char id, bool status, bool report, bool group_report) } bool relayStatus(unsigned char id, bool status) { - return relayStatus(id, status, true, true); + return relayStatus(id, status, RELAY_REPORT_STATUS, true); } bool relayStatus(unsigned char id) {