[RTL_433 Discovery] Do not store the devices if discovery off (#1518)
This commit is contained in:
1 parent
9e642de3aa
commit
7567552a58
1 file changed
+3
-2
@@ -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
|
# endif
|
||||||
|
|
||||||
void rtl_433_Callback(char* message) {
|
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());
|
Log.notice(F("uniqueid: %s" CR), uniqueid.c_str());
|
||||||
if (!isAduplicateSignal(MQTTvalue)) {
|
if (!isAduplicateSignal(MQTTvalue)) {
|
||||||
|
# ifdef ZmqttDiscovery
|
||||||
|
if (disc)
|
||||||
storeRTL_433Discovery(RFrtl_433_ESPdata, (char*)model.c_str(), (char*)uniqueid.c_str());
|
storeRTL_433Discovery(RFrtl_433_ESPdata, (char*)model.c_str(), (char*)uniqueid.c_str());
|
||||||
|
# endif
|
||||||
pub((char*)topic.c_str(), RFrtl_433_ESPdata);
|
pub((char*)topic.c_str(), RFrtl_433_ESPdata);
|
||||||
storeSignalValue(MQTTvalue);
|
storeSignalValue(MQTTvalue);
|
||||||
pubOled((char*)topic.c_str(), RFrtl_433_ESPdata);
|
pubOled((char*)topic.c_str(), RFrtl_433_ESPdata);
|
||||||
|
|||||||
Reference in new issue
Block a user