Allow skip parsing template result (#42401)

This commit is contained in:
Franck Nijhof 2020-10-26 16:01:09 +01:00 committed by GitHub
parent 80e8068b46
commit 45aba9bdf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 98 additions and 24 deletions

View file

@ -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