1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 05:12:21 +01:00

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

View File

@@ -9,14 +9,13 @@
namespace esphome {
namespace mdns {
static const char *const TAG = "mdns";
void MDNSComponent::setup() {
network::IPAddress addr = network::get_ip_address();
MDNS.begin(compile_hostname_().c_str(), (uint32_t) addr);
this->compile_records_();
auto services = compile_services_();
for (const auto &service : services) {
network::IPAddress addr = network::get_ip_address();
MDNS.begin(this->hostname_.c_str(), (uint32_t) addr);
for (const auto &service : this->services_) {
// Strip the leading underscore from the proto and service_type. While it is
// part of the wire protocol to have an underscore, and for example ESP-IDF
// expects the underscore to be there, the ESP8266 implementation always adds