mirror of
https://github.com/esphome/esphome.git
synced 2025-10-10 22:03:46 +01:00
[mdns] Support templatable config options for MDNS extra services (#8606)
This commit is contained in:
@@ -29,9 +29,11 @@ void MDNSComponent::setup() {
|
||||
while (*service_type == '_') {
|
||||
service_type++;
|
||||
}
|
||||
MDNS.addService(service_type, proto, service.port);
|
||||
uint16_t port = const_cast<TemplatableValue<uint16_t> &>(service.port).value();
|
||||
MDNS.addService(service_type, proto, port);
|
||||
for (const auto &record : service.txt_records) {
|
||||
MDNS.addServiceTxt(service_type, proto, record.key.c_str(), record.value.c_str());
|
||||
MDNS.addServiceTxt(service_type, proto, record.key.c_str(),
|
||||
const_cast<TemplatableValue<std::string> &>(record.value).value().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user