1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-19 02:03:48 +01:00

just store key in flash

This commit is contained in:
J. Nick Koston
2025-10-07 14:54:28 -05:00
parent 9cecbee33a
commit cf1ba30e90
7 changed files with 8 additions and 8 deletions

View File

@@ -181,7 +181,7 @@ void OpenThreadSrpComponent::setup() {
for (size_t i = 0; i < service.txt_records.size(); i++) {
const auto &txt = service.txt_records[i];
auto value = const_cast<TemplatableValue<std::string> &>(txt.value).value();
txt_entries[i].mKey = strdup(txt.key.c_str());
txt_entries[i].mKey = txt.key; // Compile-time string literal in flash
txt_entries[i].mValue = reinterpret_cast<const uint8_t *>(strdup(value.c_str()));
txt_entries[i].mValueLength = value.size();
}