Use report_usage in helpers (#130365)

This commit is contained in:
epenet
2024-11-12 09:25:13 +01:00
committed by GitHub
parent 22aed92461
commit 7045b776b6
5 changed files with 19 additions and 23 deletions

View File

@ -719,14 +719,14 @@ def template(value: Any | None) -> template_helper.Template:
raise vol.Invalid("template value should be a string")
if not (hass := _async_get_hass_or_none()):
# pylint: disable-next=import-outside-toplevel
from .frame import report
from .frame import ReportBehavior, report_usage
report(
report_usage(
(
"validates schema outside the event loop, "
"which will stop working in HA Core 2025.10"
),
error_if_core=False,
core_behavior=ReportBehavior.LOG,
)
template_value = template_helper.Template(str(value), hass)
@ -748,14 +748,14 @@ def dynamic_template(value: Any | None) -> template_helper.Template:
raise vol.Invalid("template value does not contain a dynamic template")
if not (hass := _async_get_hass_or_none()):
# pylint: disable-next=import-outside-toplevel
from .frame import report
from .frame import ReportBehavior, report_usage
report(
report_usage(
(
"validates schema outside the event loop, "
"which will stop working in HA Core 2025.10"
),
error_if_core=False,
core_behavior=ReportBehavior.LOG,
)
template_value = template_helper.Template(str(value), hass)