[text] Store pattern as const char* to reduce memory usage

This commit is contained in:
J. Nick Koston
2025-12-06 23:55:38 -06:00
parent e63673f5ef
commit 188148546e
+1 -1
View File
@@ -1211,7 +1211,7 @@ std::string WebServer::text_json(text::Text *obj, const std::string &value, Json
set_json_icon_state_value(root, obj, "text", state, value, start_config);
root[ESPHOME_F("min_length")] = obj->traits.get_min_length();
root[ESPHOME_F("max_length")] = obj->traits.get_max_length();
root[ESPHOME_F("pattern")] = obj->traits.get_pattern_ref();
root[ESPHOME_F("pattern")] = obj->traits.get_pattern_c_str();
if (start_config == DETAIL_ALL) {
root[ESPHOME_F("mode")] = (int) obj->traits.get_mode();
this->add_sorting_info_(root, obj);