Add Home Assistant configuration URL
This commit is contained in:
12
Network.cpp
12
Network.cpp
@@ -719,6 +719,18 @@ void Network::publishHASSConfig(char* deviceType, const char* baseTopic, char* n
|
||||
json["dev"]["mf"] = "Nuki";
|
||||
json["dev"]["mdl"] = deviceType;
|
||||
json["dev"]["name"] = name;
|
||||
|
||||
String cuUrl = _preferences->getString(preference_mqtt_hass_cu_url);
|
||||
|
||||
if (cuUrl != "")
|
||||
{
|
||||
json["dev"]["cu"] = cuUrl;
|
||||
}
|
||||
else
|
||||
{
|
||||
json["dev"]["cu"] = "http://" + _device->localIP();
|
||||
}
|
||||
|
||||
json["~"] = baseTopic;
|
||||
json["name"] = nullptr;
|
||||
json["unique_id"] = String(uidString) + "_lock";
|
||||
|
||||
Reference in New Issue
Block a user