1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-18 07:45:56 +00:00

[mdns] Conditionally store services to reduce RAM usage by 200-464 bytes (#11180)

This commit is contained in:
J. Nick Koston
2025-10-13 08:24:57 -10:00
committed by GitHub
parent bcc424afed
commit c10f68ef0c
10 changed files with 54 additions and 18 deletions

View File

@@ -12,11 +12,12 @@ namespace esphome {
namespace mdns {
void MDNSComponent::setup() {
this->compile_records_();
StaticVector<MDNSService, MDNS_SERVICE_COUNT> services;
this->compile_records_(services);
MDNS.begin(this->hostname_.c_str());
for (const auto &service : this->services_) {
for (const auto &service : 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