[BLE] Simplify the publication of advertisement data (#1408)
With only one control that enables the publication of all the advertisement data, default: false Note that if the sensor is not recognized, we will no longer publish its advertisement data unless the control is true. This is for the sake of traffic reduction.
This commit is contained in:
1 parent
27b568e4f9
commit
a3603c6a78
5 files changed
+41
-85
No files matched your search
@@ -997,6 +997,16 @@ void pubMqttDiscovery() {
|
||||
stateClassNone, //State Class
|
||||
"false", "true" //state_off, state_on
|
||||
);
|
||||
createDiscovery("switch", //set Type
|
||||
subjectBTtoMQTT, "BT: Publish Advertisement data", (char*)getUniqueId("pubadvdata", "").c_str(), //set state_topic,name,uniqueId
|
||||
"", "", "{{ value_json.pubadvdata }}", //set availability_topic,device_class,value_template,
|
||||
"{\"pubadvdata\":true,\"save\":true}", "{\"pubadvdata\":false,\"save\":true}", "", //set,payload_on,payload_off,unit_of_meas,
|
||||
0, //set off_delay
|
||||
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_available,payload_not available ,is a gateway entity, command topic
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone, //State Class
|
||||
"false", "true" //state_off, state_on
|
||||
);
|
||||
createDiscovery("switch", //set Type
|
||||
subjectBTtoMQTT, "BT: Connect to devices", (char*)getUniqueId("bleconnect", "").c_str(), //set state_topic,name,uniqueId
|
||||
"", "", "{{ value_json.bleconnect }}", //set availability_topic,device_class,value_template,
|
||||
|
||||
Reference in new issue
Block a user