mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-06-15 20:36:31 +03:00
show custom system name as model in HA
This commit is contained in:
@@ -545,8 +545,8 @@ void Mqtt::ha_status() {
|
|||||||
JsonObject dev = doc["dev"].to<JsonObject>();
|
JsonObject dev = doc["dev"].to<JsonObject>();
|
||||||
dev["name"] = Mqtt::basename();
|
dev["name"] = Mqtt::basename();
|
||||||
dev["sw"] = "v" + std::string(EMSESP_APP_VERSION);
|
dev["sw"] = "v" + std::string(EMSESP_APP_VERSION);
|
||||||
dev["mf"] = "EMS-ESP";
|
dev["mf"] = "EMS-ESP"; // manufacturer is EMS-ESP always
|
||||||
dev["mdl"] = "EMS-ESP";
|
dev["mdl"] = EMSESP::system_.system_name().empty() ? "EMS-ESP" : EMSESP::system_.system_name(); // use users custom system name if set
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
dev["cu"] = std::string("http://") + EMSESP::system_.get_ip_or_hostname().c_str();
|
dev["cu"] = std::string("http://") + EMSESP::system_.get_ip_or_hostname().c_str();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user