mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 12:36:52 +03:00
renaming
This commit is contained in:
@@ -33,6 +33,7 @@ void sendHomeAssistantDiscoveryTopic(std::string maintopic, std::string group, s
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string topic;
|
std::string topic;
|
||||||
|
std::string topicFull;
|
||||||
std::string topicT;
|
std::string topicT;
|
||||||
std::string payload;
|
std::string payload;
|
||||||
std::string nl = "\n";
|
std::string nl = "\n";
|
||||||
@@ -53,7 +54,7 @@ void sendHomeAssistantDiscoveryTopic(std::string maintopic, std::string group, s
|
|||||||
userFriendlyName = group + " " + userFriendlyName;
|
userFriendlyName = group + " " + userFriendlyName;
|
||||||
}
|
}
|
||||||
|
|
||||||
topic = "homeassistant/sensor/" + maintopic + "-" + topicT + "/config";
|
topicFull = "homeassistant/sensor/" + maintopic + "/" + topicT + "/config";
|
||||||
|
|
||||||
/* See https://www.home-assistant.io/docs/mqtt/discovery/ */
|
/* See https://www.home-assistant.io/docs/mqtt/discovery/ */
|
||||||
payload = "{" + nl +
|
payload = "{" + nl +
|
||||||
@@ -86,7 +87,7 @@ void sendHomeAssistantDiscoveryTopic(std::string maintopic, std::string group, s
|
|||||||
"}" + nl +
|
"}" + nl +
|
||||||
"}" + nl;
|
"}" + nl;
|
||||||
|
|
||||||
MQTTPublish(topic, payload, true);
|
MQTTPublish(topicFull, payload, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MQTThomeassistantDiscovery(std::string maintopic) {
|
void MQTThomeassistantDiscovery(std::string maintopic) {
|
||||||
|
|||||||
Reference in New Issue
Block a user