Skip to content

Commit

Permalink
[RTL_433 Discovery] Do not store the devices if discovery off (#1518)
Browse files Browse the repository at this point in the history
  • Loading branch information
1technophile authored Mar 10, 2023
1 parent 9e642de commit 7567552
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main/ZgatewayRTL_433.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7567552

Please sign in to comment.