1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-16 15:37:51 +02:00

Merge branch 'fixed_vector_mdns_txt_records' into integration

This commit is contained in:
J. Nick Koston 2025-10-13 21:14:46 -10:00
commit 19c8a638f4
No known key found for this signature in database
5 changed files with 20 additions and 5 deletions

View File

@ -173,11 +173,6 @@ void MDNSComponent::compile_records_(StaticVector<MDNSService, MDNS_SERVICE_COUN
fallback_service.port = USE_WEBSERVER_PORT; fallback_service.port = USE_WEBSERVER_PORT;
fallback_service.txt_records = {{MDNS_STR(TXT_VERSION), MDNS_STR(VALUE_VERSION)}}; fallback_service.txt_records = {{MDNS_STR(TXT_VERSION), MDNS_STR(VALUE_VERSION)}};
#endif #endif
#ifdef USE_MDNS_STORE_SERVICES
// Move to member variable if storage is enabled (verbose logging, OpenThread, or extra services)
this->services_ = std::move(services);
#endif
} }
void MDNSComponent::dump_config() { void MDNSComponent::dump_config() {

View File

@ -12,8 +12,13 @@ namespace mdns {
static const char *const TAG = "mdns"; static const char *const TAG = "mdns";
void MDNSComponent::setup() { void MDNSComponent::setup() {
#ifdef USE_MDNS_STORE_SERVICES
this->compile_records_(this->services_);
const auto &services = this->services_;
#else
StaticVector<MDNSService, MDNS_SERVICE_COUNT> services; StaticVector<MDNSService, MDNS_SERVICE_COUNT> services;
this->compile_records_(services); this->compile_records_(services);
#endif
esp_err_t err = mdns_init(); esp_err_t err = mdns_init();
if (err != ESP_OK) { if (err != ESP_OK) {

View File

@ -12,8 +12,13 @@ namespace esphome {
namespace mdns { namespace mdns {
void MDNSComponent::setup() { void MDNSComponent::setup() {
#ifdef USE_MDNS_STORE_SERVICES
this->compile_records_(this->services_);
const auto &services = this->services_;
#else
StaticVector<MDNSService, MDNS_SERVICE_COUNT> services; StaticVector<MDNSService, MDNS_SERVICE_COUNT> services;
this->compile_records_(services); this->compile_records_(services);
#endif
MDNS.begin(this->hostname_.c_str()); MDNS.begin(this->hostname_.c_str());

View File

@ -12,8 +12,13 @@ namespace esphome {
namespace mdns { namespace mdns {
void MDNSComponent::setup() { void MDNSComponent::setup() {
#ifdef USE_MDNS_STORE_SERVICES
this->compile_records_(this->services_);
const auto &services = this->services_;
#else
StaticVector<MDNSService, MDNS_SERVICE_COUNT> services; StaticVector<MDNSService, MDNS_SERVICE_COUNT> services;
this->compile_records_(services); this->compile_records_(services);
#endif
MDNS.begin(this->hostname_.c_str()); MDNS.begin(this->hostname_.c_str());

View File

@ -12,8 +12,13 @@ namespace esphome {
namespace mdns { namespace mdns {
void MDNSComponent::setup() { void MDNSComponent::setup() {
#ifdef USE_MDNS_STORE_SERVICES
this->compile_records_(this->services_);
const auto &services = this->services_;
#else
StaticVector<MDNSService, MDNS_SERVICE_COUNT> services; StaticVector<MDNSService, MDNS_SERVICE_COUNT> services;
this->compile_records_(services); this->compile_records_(services);
#endif
MDNS.begin(this->hostname_.c_str()); MDNS.begin(this->hostname_.c_str());