From eda270fde28ea31a29cfbb33c7b76d645daf46c9 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 6 Jun 2023 08:56:58 -0500 Subject: [PATCH] avoid teaching templates about persistent_notification --- homeassistant/helpers/template.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index c1244c8856..ace9e0d393 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -458,7 +458,7 @@ class RenderInfo: @callback def async_register_hass_environment_function( - hass: HomeAssistant, name: str, func: Callable[..., Any] + hass: HomeAssistant, name: str, func: Callable[Concatenate[HomeAssistant, _P], _R] ) -> None: """Register the environment function.""" for env in _ENVIRONMENTS: @@ -2530,7 +2530,9 @@ class TemplateEnvironment(ImmutableSandboxedEnvironment): return pass_context(wrapper) - def async_register_hass_function(self, name: str, func: Callable[..., Any]) -> None: + def async_register_hass_function( + self, name: str, func: Callable[Concatenate[HomeAssistant, _P], _R] + ) -> None: """Register a function that needs to be wrapped with hass.""" hass_func = self.hassfunction(func) self.globals[name] = hass_func