1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 16:25:50 +00:00

[mdns] Eliminate redundant hostname copy to save heap memory

This commit is contained in:
J. Nick Koston
2025-11-05 11:19:06 -06:00
parent b7838671ae
commit ed0d9e60b8
6 changed files with 11 additions and 9 deletions

View File

@@ -4,6 +4,7 @@
#include <ESP8266mDNS.h>
#include "esphome/components/network/ip_address.h"
#include "esphome/components/network/util.h"
#include "esphome/core/application.h"
#include "esphome/core/hal.h"
#include "esphome/core/log.h"
#include "mdns_component.h"
@@ -20,7 +21,7 @@ void MDNSComponent::setup() {
this->compile_records_(services);
#endif
MDNS.begin(this->hostname_.c_str());
MDNS.begin(App.get_name().c_str());
for (const auto &service : services) {
// Strip the leading underscore from the proto and service_type. While it is