Add mDNS config dump (#2576)

This commit is contained in:
Maurice Makaay
2021-10-21 16:02:28 +02:00
committed by GitHub
parent cac5b356db
commit f2ebfe7aef
5 changed files with 40 additions and 26 deletions
@@ -7,13 +7,12 @@
namespace esphome {
namespace mdns {
static const char *const TAG = "mdns";
void MDNSComponent::setup() {
MDNS.begin(compile_hostname_().c_str());
this->compile_records_();
auto services = compile_services_();
for (const auto &service : services) {
MDNS.begin(this->hostname_.c_str());
for (const auto &service : this->services_) {
MDNS.addService(service.service_type.c_str(), service.proto.c_str(), service.port);
for (const auto &record : service.txt_records) {
MDNS.addServiceTxt(service.service_type.c_str(), service.proto.c_str(), record.key.c_str(), record.value.c_str());