mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 12:27:13 +01:00
Add friendly name in MDNS records if it is not empty (#4317)
This commit is contained in:
parent
f2eafa8fbe
commit
6d65671f92
@ -30,7 +30,7 @@ void MDNSComponent::compile_records_() {
|
|||||||
service.service_type = "_esphomelib";
|
service.service_type = "_esphomelib";
|
||||||
service.proto = "_tcp";
|
service.proto = "_tcp";
|
||||||
service.port = api::global_api_server->get_port();
|
service.port = api::global_api_server->get_port();
|
||||||
if (App.get_friendly_name().empty()) {
|
if (!App.get_friendly_name().empty()) {
|
||||||
service.txt_records.push_back({"friendly_name", App.get_friendly_name()});
|
service.txt_records.push_back({"friendly_name", App.get_friendly_name()});
|
||||||
}
|
}
|
||||||
service.txt_records.push_back({"version", ESPHOME_VERSION});
|
service.txt_records.push_back({"version", ESPHOME_VERSION});
|
||||||
|
Loading…
Reference in New Issue
Block a user