mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 02:19:31 +00:00
Make more max lengths constants and add additional MaxLengthExceeded checks (#50337)
* Add more MaxLengthExceeded checks * remove some validations to reduce performance impact * check length of generated entity ID * dont check entity ID twice and use single context id length constant * fix test * add missing test
This commit is contained in:
@@ -26,9 +26,14 @@ ENTITY_MATCH_ALL: Final = "all"
|
||||
# If no name is specified
|
||||
DEVICE_DEFAULT_NAME: Final = "Unnamed Device"
|
||||
|
||||
# Max characters for an event_type (changing this requires a recorder
|
||||
# database migration)
|
||||
MAX_LENGTH_EVENT_TYPE: Final = 64
|
||||
# Max characters for data stored in the recorder (changes to these limits would require
|
||||
# a database migration)
|
||||
MAX_LENGTH_EVENT_EVENT_TYPE: Final = 64
|
||||
MAX_LENGTH_EVENT_ORIGIN: Final = 32
|
||||
MAX_LENGTH_EVENT_CONTEXT_ID: Final = 36
|
||||
MAX_LENGTH_STATE_DOMAIN: Final = 64
|
||||
MAX_LENGTH_STATE_ENTITY_ID: Final = 255
|
||||
MAX_LENGTH_STATE_STATE: Final = 255
|
||||
|
||||
# Sun events
|
||||
SUN_EVENT_SUNSET: Final = "sunset"
|
||||
|
||||
Reference in New Issue
Block a user