[Discovery] Re-add the discovery switch (#1506)

revert #1365, indeed the switch may be usefull to avoid non desirable discovery of RTL_433 or BT devices  #1487
This commit is contained in:
Florian authored and GitHub committed 2023-03-06 14:18:05 -06:00
1 parent 6e8ada44b5
commit d9bac3be44
1 file changed
+9
+9
View File
@@ -516,6 +516,15 @@ void pubMqttDiscovery() {
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
createDiscovery("switch", //set Type
"", "SYS: Auto discovery", (char*)getUniqueId("discovery", "").c_str(), //set state_topic,name,uniqueId
will_Topic, "", "", //set availability_topic,device_class,value_template,
"{\"discovery\":true}", "{\"discovery\":false}", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain,
stateClassNone //State Class
);
# endif
# ifdef ZboardM5STACK
createDiscovery("sensor", //set Type