mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add type hints on Template().__init__() (#82574)
This commit is contained in:
@@ -594,7 +594,7 @@ def template(value: Any | None) -> template_helper.Template:
|
||||
if isinstance(value, (list, dict, template_helper.Template)):
|
||||
raise vol.Invalid("template value should be a string")
|
||||
|
||||
template_value = template_helper.Template(str(value)) # type: ignore[no-untyped-call]
|
||||
template_value = template_helper.Template(str(value))
|
||||
|
||||
try:
|
||||
template_value.ensure_valid()
|
||||
@@ -612,7 +612,7 @@ def dynamic_template(value: Any | None) -> template_helper.Template:
|
||||
if not template_helper.is_template_string(str(value)):
|
||||
raise vol.Invalid("template value does not contain a dynamic template")
|
||||
|
||||
template_value = template_helper.Template(str(value)) # type: ignore[no-untyped-call]
|
||||
template_value = template_helper.Template(str(value))
|
||||
try:
|
||||
template_value.ensure_valid()
|
||||
return template_value
|
||||
|
||||
Reference in New Issue
Block a user