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

This commit is contained in:
J. Nick Koston
2025-12-06 23:50:48 -06:00
parent 0610b3a60a
commit 789faca7c4
2 changed files with 4 additions and 0 deletions

View File

@@ -143,6 +143,7 @@ text:
mode: text
min_length: 0
max_length: 255
pattern: "[A-Za-z0-9 ]+"
initial_value: "Initial value"
update_interval: 5.0s

View File

@@ -141,6 +141,9 @@ async def test_api_message_size_batching(
assert text_input.max_length == 255, (
f"Expected max_length 255, got {text_input.max_length}"
)
assert text_input.pattern == "[A-Za-z0-9 ]+", (
f"Expected pattern '[A-Za-z0-9 ]+', got '{text_input.pattern}'"
)
# Verify total entity count - messages of various sizes were batched successfully
# We have: 3 selects + 3 text sensors + 1 text input + 1 number = 8 total