mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Small speed up to validating entity ids (#92970)
This commit is contained in:
parent
02b5d643e7
commit
93bfd7d8d0
@ -567,6 +567,10 @@ def string(value: Any) -> str:
|
||||
if value is None:
|
||||
raise vol.Invalid("string value is None")
|
||||
|
||||
# This is expected to be the most common case, so check it first.
|
||||
if type(value) is str: # pylint: disable=unidiomatic-typecheck
|
||||
return value
|
||||
|
||||
if isinstance(value, template_helper.ResultWrapper):
|
||||
value = value.render_result
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user