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

[mdns] Conditionally compile extra services to reduce flash usage (#10129)

This commit is contained in:
J. Nick Koston
2025-08-07 14:32:35 -10:00
committed by GitHub
parent c4d1b1317a
commit 76fd104fb6
3 changed files with 9 additions and 0 deletions

View File

@@ -35,14 +35,18 @@ class MDNSComponent : public Component {
#endif
float get_setup_priority() const override { return setup_priority::AFTER_CONNECTION; }
#ifdef USE_MDNS_EXTRA_SERVICES
void add_extra_service(MDNSService service) { services_extra_.push_back(std::move(service)); }
#endif
std::vector<MDNSService> get_services();
void on_shutdown() override;
protected:
#ifdef USE_MDNS_EXTRA_SERVICES
std::vector<MDNSService> services_extra_{};
#endif
std::vector<MDNSService> services_{};
std::string hostname_;
void compile_records_();