From b543865a96e95d3146e3045c4e6d26766c056e96 Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Fri, 10 Mar 2023 07:42:16 -0600 Subject: [PATCH] [RTL_433 Discovery] Do not store the devices if discovery off --- main/ZgatewayRTL_433.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main/ZgatewayRTL_433.ino b/main/ZgatewayRTL_433.ino index a2094a7725..32ff166eb5 100644 --- a/main/ZgatewayRTL_433.ino +++ b/main/ZgatewayRTL_433.ino @@ -214,8 +214,6 @@ void storeRTL_433Discovery(JsonObject& RFrtl_433_ESPdata, const char* model, con } } } -# else -void storeRTL_433Discovery(JsonObject& RFrtl_433_ESPdata, const char* model, const char* uniqueid) {} # endif void rtl_433_Callback(char* message) { @@ -252,7 +250,10 @@ void rtl_433_Callback(char* message) { Log.notice(F("uniqueid: %s" CR), uniqueid.c_str()); if (!isAduplicateSignal(MQTTvalue)) { - storeRTL_433Discovery(RFrtl_433_ESPdata, (char*)model.c_str(), (char*)uniqueid.c_str()); +# ifdef ZmqttDiscovery + if (disc) + storeRTL_433Discovery(RFrtl_433_ESPdata, (char*)model.c_str(), (char*)uniqueid.c_str()); +# endif pub((char*)topic.c_str(), RFrtl_433_ESPdata); storeSignalValue(MQTTvalue); pubOled((char*)topic.c_str(), RFrtl_433_ESPdata);