Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.template.TemplateContextManager Class Reference
Inheritance diagram for homeassistant.helpers.template.TemplateContextManager:
[legend]
Collaboration diagram for homeassistant.helpers.template.TemplateContextManager:
[legend]

Public Member Functions

None __exit__ (self, type[BaseException]|None exc_type, BaseException|None exc_value, TracebackType|None traceback)
 
None set_template (self, str template_str, str action)
 

Detailed Description

Context manager to store template being parsed or rendered in a ContextVar.

Definition at line 2707 of file template.py.

Member Function Documentation

◆ __exit__()

None homeassistant.helpers.template.TemplateContextManager.__exit__ (   self,
type[BaseException] | None  exc_type,
BaseException | None  exc_value,
TracebackType | None  traceback 
)
Raise any exception triggered within the runtime context.

Definition at line 2714 of file template.py.

◆ set_template()

None homeassistant.helpers.template.TemplateContextManager.set_template (   self,
str  template_str,
str  action 
)
Store template being parsed or rendered in a Contextvar to aid error handling.

Definition at line 2710 of file template.py.


The documentation for this class was generated from the following file: