Allow skip parsing template result (#42401)
This commit is contained in:
parent
80e8068b46
commit
45aba9bdf2
10 changed files with 98 additions and 24 deletions
|
@ -410,7 +410,7 @@ class APITemplateView(HomeAssistantView):
|
|||
try:
|
||||
data = await request.json()
|
||||
tpl = template.Template(data["template"], request.app["hass"])
|
||||
return str(tpl.async_render(data.get("variables")))
|
||||
return tpl.async_render(variables=data.get("variables"), parse_result=False)
|
||||
except (ValueError, TemplateError) as ex:
|
||||
return self.json_message(
|
||||
f"Error rendering template: {ex}", HTTP_BAD_REQUEST
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue