Make _TrackTemplateResultInfo not private (#79812)

This commit is contained in:
HarvsG 2022-10-09 14:23:08 +01:00 committed by GitHub
parent a2ed7f7679
commit e5dafbc166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -806,7 +806,7 @@ def async_track_template(
track_template = threaded_listener_factory(async_track_template)
class _TrackTemplateResultInfo:
class TrackTemplateResultInfo:
"""Handle removal / refresh of tracker."""
def __init__(
@ -1145,7 +1145,7 @@ def async_track_template_result(
raise_on_template_error: bool = False,
strict: bool = False,
has_super_template: bool = False,
) -> _TrackTemplateResultInfo:
) -> TrackTemplateResultInfo:
"""Add a listener that fires when the result of a template changes.
The action will fire with the initial result from the template, and
@ -1184,9 +1184,7 @@ def async_track_template_result(
Info object used to unregister the listener, and refresh the template.
"""
tracker = _TrackTemplateResultInfo(
hass, track_templates, action, has_super_template
)
tracker = TrackTemplateResultInfo(hass, track_templates, action, has_super_template)
tracker.async_setup(raise_on_template_error, strict=strict)
return tracker