mqtt: announce hardware and software version (#396)

This commit is contained in:
David Girón
2024-06-07 13:21:58 +02:00
committed by GitHub
parent bf3400b878
commit 552589a2c6
8 changed files with 13 additions and 11 deletions

View File

@@ -758,7 +758,7 @@ bool Network::publishString(const char* prefix, const char *topic, const char *v
return _device->mqttPublish(path, MQTT_QOS_LEVEL, true, value) > 0;
}
void Network::publishHASSConfig(char* deviceType, const char* baseTopic, char* name, char* uidString, const char* availabilityTopic, const bool& hasKeypad, char* lockAction, char* unlockAction, char* openAction)
void Network::publishHASSConfig(char* deviceType, const char* baseTopic, char* name, char* uidString, const char *softwareVersion, const char *hardwareVersion, const char* availabilityTopic, const bool& hasKeypad, char* lockAction, char* unlockAction, char* openAction)
{
JsonDocument json;
json.clear();
@@ -768,6 +768,8 @@ void Network::publishHASSConfig(char* deviceType, const char* baseTopic, char* n
json["dev"]["mf"] = "Nuki";
json["dev"]["mdl"] = deviceType;
json["dev"]["name"] = name;
json["dev"]["sw"] = softwareVersion;
json["dev"]["hw"] = hardwareVersion;
String cuUrl = _preferences->getString(preference_mqtt_hass_cu_url);