diff --git a/homeassistant/helpers/template/__init__.py b/homeassistant/helpers/template/__init__.py index 13d67e6939d..05f16f4355e 100644 --- a/homeassistant/helpers/template/__init__.py +++ b/homeassistant/helpers/template/__init__.py @@ -8,6 +8,7 @@ import collections.abc from collections.abc import Callable, Generator, Iterable from copy import deepcopy from datetime import datetime, timedelta +from enum import Enum from functools import cache, lru_cache, partial, wraps import json import logging @@ -57,7 +58,10 @@ from homeassistant.core import ( from homeassistant.exceptions import TemplateError from homeassistant.helpers import entity_registry as er, location as loc_helper from homeassistant.helpers.singleton import singleton -from homeassistant.helpers.translation import async_translate_state +from homeassistant.helpers.translation import ( + async_translate_state, + async_translate_state_attr, +) from homeassistant.helpers.typing import TemplateVarsType from homeassistant.util import convert, location as location_util from homeassistant.util.async_ import run_callback_threadsafe @@ -807,6 +811,48 @@ class StateTranslated: return "