From 1cc3ffe20dc4b03d816bf9f68a37bc42e0df2f5d Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 5 Aug 2021 21:41:50 -0700 Subject: [PATCH] Fix jinja warning (#54109) --- homeassistant/helpers/template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index 66354aa7aa6..08b3956a490 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -22,7 +22,7 @@ from urllib.parse import urlencode as urllib_urlencode import weakref import jinja2 -from jinja2 import contextfunction, pass_context +from jinja2 import pass_context from jinja2.sandbox import ImmutableSandboxedEnvironment from jinja2.utils import Namespace import voluptuous as vol @@ -1521,7 +1521,7 @@ class TemplateEnvironment(ImmutableSandboxedEnvironment): def wrapper(*args, **kwargs): return func(hass, *args[1:], **kwargs) - return contextfunction(wrapper) + return pass_context(wrapper) self.globals["device_entities"] = hassfunction(device_entities) self.filters["device_entities"] = pass_context(self.globals["device_entities"])