[BLE] Add dynamic active scan runtime setting (#1360)

This commit add the capability to set passive scanning during runtime, versus buildtime before, so as to improve energy consumption of sensors when they don't require active scanning
This commit is contained in:
Florian authored and GitHub committed 2022-12-14 17:03:34 -06:00
1 parent 807c668489
commit 8dde777fb7
4 files changed
+28 -1

No files matched your search

+9
View File
@@ -962,6 +962,15 @@ void pubMqttDiscovery() {
"", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain
stateClassNone //State Class
);
createDiscovery("switch", //set Type
"", "BT: Active scan", (char*)getUniqueId("active_scan", "").c_str(), //set state_topic,name,uniqueId
"", "", "", //set availability_topic,device_class,value_template,
"{\"activescan\":true}", "{\"activescan\":false}", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //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
);
createDiscovery("switch", //set Type
"", "BT: Publish HASS presence", (char*)getUniqueId("hasspresence", "").c_str(), //set state_topic,name,uniqueId
"", "", "", //set availability_topic,device_class,value_template,