mirror of
https://github.com/home-assistant/core.git
synced 2025-07-07 13:27:09 +00:00
Small cleanup of WS command render_template (#99562)
This commit is contained in:
parent
26fd36dc4c
commit
7e36da4cc0
@ -516,7 +516,6 @@ async def handle_render_template(
|
||||
template_obj = _cached_template(template_str, hass)
|
||||
variables = msg.get("variables")
|
||||
timeout = msg.get("timeout")
|
||||
info = None
|
||||
|
||||
if timeout:
|
||||
try:
|
||||
@ -540,7 +539,6 @@ async def handle_render_template(
|
||||
event: EventType[EventStateChangedData] | None,
|
||||
updates: list[TrackTemplateResult],
|
||||
) -> None:
|
||||
nonlocal info
|
||||
track_template_result = updates.pop()
|
||||
result = track_template_result.result
|
||||
if isinstance(result, TemplateError):
|
||||
@ -549,7 +547,7 @@ async def handle_render_template(
|
||||
|
||||
connection.send_message(
|
||||
messages.event_message(
|
||||
msg["id"], {"result": result, "listeners": info.listeners} # type: ignore[attr-defined]
|
||||
msg["id"], {"result": result, "listeners": info.listeners}
|
||||
)
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user