Change unique id structure for HASS discovery (#1147)

Now:
"uniq_id":"882D777014C-pres"
before it was:
"uniq_id":"882D7770014C-CLEARGRASSTRHKPA-pres"
This will impact BLE and gateways entities
This commit is contained in:
Florian authored and GitHub committed 2022-01-27 15:47:29 -06:00
1 parent 5c8fd626ec
commit a9342f743f
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -843,7 +843,7 @@ void launchBTDiscovery() {
Log.trace("Name: %s", prop.value()["name"].as<const char*>());
String discovery_topic = String(subjectBTtoMQTT) + "/" + macWOdots;
String entity_name = String(model_id.c_str()) + "-" + String(prop.key().c_str());
String unique_id = macWOdots + "-" + entity_name;
String unique_id = macWOdots + "-" + String(prop.key().c_str());
# if OpenHABDiscovery
String value_template = "{{ value_json." + String(prop.key().c_str()) + "}}";
# else
+1 -1
View File
@@ -43,7 +43,7 @@ String getMacAddress() {
}
String getUniqueId(String name, String sufix) {
String uniqueId = (String)getMacAddress() + name + sufix;
String uniqueId = (String)getMacAddress() + "-" + name + sufix;
return String(uniqueId);
}