fix: generation of default_entity_id for HA fixed

This commit is contained in:
Yurii
2025-11-12 20:21:39 +03:00
parent 0b60734a3b
commit e573ce582f
2 changed files with 95 additions and 83 deletions

View File

@@ -147,8 +147,19 @@ public:
return topic;
}
template <class DT, class VT>
String getEntityIdWithPrefix(DT domain, VT value, char separator = '_') {
String topic = "";
topic.concat(domain);
topic.concat('.');
topic.concat(this->devicePrefix);
topic.concat(separator);
topic.concat(value);
return topic;
}
template <class T>
String getObjectIdWithPrefix(T value, char separator = '_') {
String getUniqueIdWithPrefix(T value, char separator = '_') {
String topic = "";
topic.concat(this->devicePrefix);
topic.concat(separator);