[DISC] always auto-discover Presence/Tracker timeout (#1959)

auto-discover Presence/Tracker timeout even when HASS presence is not active

Also inject an additional placeholder rssi key and value into the BM2 voltage connection message to avoid the message being registered as a device tracker AWAY

https://community.openmqttgateway.com/t/bm2-home-and-away/3315
This commit is contained in:
DigiH authored and GitHub committed 2024-06-10 11:50:08 -05:00
1 parent 6e906702ed
commit d538316e03
3 files changed
+11 -15

No files matched your search

-4
View File
@@ -156,10 +156,6 @@ void BTConfig_fromJson(JsonObject& BTdata, bool startup = false) {
if (startup == false) {
if (BTdata.containsKey("hasspresence") && BTdata["hasspresence"] == false && BTConfig.presenceEnable == true) {
BTdata["adaptivescan"] = true;
# ifdef ZmqttDiscovery
// Remove discovered entities
eraseTopic("number", (char*)getUniqueId("presenceawaytimer", "").c_str());
# endif
} else if (BTdata.containsKey("hasspresence") && BTdata["hasspresence"] == true && BTConfig.presenceEnable == false) {
BTdata["adaptivescan"] = false;
}