[SYS] Add save option to discovery and ohdiscovery key and remove discovery for Arduino boards (#1696)

Enabling to keep discovery off if required

Remove Mqtt discovery for Arduino UNO and ATMEGA
This commit is contained in:
Florian authored and GitHub committed 2023-07-30 17:34:58 -05:00
1 parent 7405499f15
commit a6c0a3b1d4
10 files changed
+110 -26

No files matched your search

+2 -2
View File
@@ -129,7 +129,7 @@ void launchRTL_433Discovery(bool overrideDiscovery) {
DISCOVERY_TRACE_LOG(F("idWoKey %s" CR), idWoKey.c_str());
String value_template = "{{ value_json." + String(parameters[i][0]) + " | is_defined }}";
if (strcmp(parameters[i][0], "battery_ok") == 0) {
if (OpenHABDisc) {
if (SYSConfig.ohdiscovery) {
value_template = "{{ value_json." + String(parameters[i][0]) + " * 99 + 1 }}"; // https://github.com/merbanan/rtl_433/blob/93f0f30c28cfb6b82b8cc3753415b01a85bee91d/examples/rtl_433_mqtt_hass.py#L187
} else {
value_template = "{{ float(value_json." + String(parameters[i][0]) + ") * 99 + 1 | is_defined }}"; // https://github.com/merbanan/rtl_433/blob/93f0f30c28cfb6b82b8cc3753415b01a85bee91d/examples/rtl_433_mqtt_hass.py#L187
@@ -254,7 +254,7 @@ void rtl_433_Callback(char* message) {
// Log.notice(F("uniqueid: %s" CR), uniqueid.c_str());
if (!isAduplicateSignal(MQTTvalue)) {
# ifdef ZmqttDiscovery
if (disc)
if (SYSConfig.discovery)
storeRTL_433Discovery(RFrtl_433_ESPdata, (char*)model.c_str(), (char*)uniqueid.c_str());
# endif
pub((char*)topic.c_str(), RFrtl_433_ESPdata);