Remove unnecessary assignment of Template.hass from triggers (#123672)
This commit is contained in:
parent
77e9acd864
commit
33a22ae208
4 changed files with 0 additions and 11 deletions
|
@ -60,7 +60,6 @@ async def async_attach_trigger(
|
|||
trigger_data = trigger_info["trigger_data"]
|
||||
variables = trigger_info["variables"]
|
||||
|
||||
template.attach(hass, config[CONF_EVENT_TYPE])
|
||||
event_types = template.render_complex(
|
||||
config[CONF_EVENT_TYPE], variables, limited=True
|
||||
)
|
||||
|
@ -72,7 +71,6 @@ async def async_attach_trigger(
|
|||
event_data_items: ItemsView | None = None
|
||||
if CONF_EVENT_DATA in config:
|
||||
# Render the schema input
|
||||
template.attach(hass, config[CONF_EVENT_DATA])
|
||||
event_data = {}
|
||||
event_data.update(
|
||||
template.render_complex(config[CONF_EVENT_DATA], variables, limited=True)
|
||||
|
@ -94,7 +92,6 @@ async def async_attach_trigger(
|
|||
event_context_items: ItemsView | None = None
|
||||
if CONF_EVENT_CONTEXT in config:
|
||||
# Render the schema input
|
||||
template.attach(hass, config[CONF_EVENT_CONTEXT])
|
||||
event_context = {}
|
||||
event_context.update(
|
||||
template.render_complex(config[CONF_EVENT_CONTEXT], variables, limited=True)
|
||||
|
|
|
@ -108,7 +108,6 @@ async def async_attach_trigger(
|
|||
below = config.get(CONF_BELOW)
|
||||
above = config.get(CONF_ABOVE)
|
||||
time_delta = config.get(CONF_FOR)
|
||||
template.attach(hass, time_delta)
|
||||
value_template = config.get(CONF_VALUE_TEMPLATE)
|
||||
unsub_track_same: dict[str, Callable[[], None]] = {}
|
||||
armed_entities: set[str] = set()
|
||||
|
@ -119,9 +118,6 @@ async def async_attach_trigger(
|
|||
trigger_data = trigger_info["trigger_data"]
|
||||
_variables = trigger_info["variables"] or {}
|
||||
|
||||
if value_template is not None:
|
||||
value_template.hass = hass
|
||||
|
||||
def variables(entity_id: str) -> dict[str, Any]:
|
||||
"""Return a dict with trigger variables."""
|
||||
trigger_info = {
|
||||
|
|
|
@ -117,7 +117,6 @@ async def async_attach_trigger(
|
|||
match_to_state = process_state_match(MATCH_ALL)
|
||||
|
||||
time_delta = config.get(CONF_FOR)
|
||||
template.attach(hass, time_delta)
|
||||
# If neither CONF_FROM or CONF_TO are specified,
|
||||
# fire on all changes to the state or an attribute
|
||||
match_all = all(
|
||||
|
|
|
@ -131,9 +131,6 @@ class HpIloSensor(SensorEntity):
|
|||
self._unit_of_measurement = unit_of_measurement
|
||||
self._ilo_function = SENSOR_TYPES[sensor_type][1]
|
||||
self.hp_ilo_data = hp_ilo_data
|
||||
|
||||
if sensor_value_template is not None:
|
||||
sensor_value_template.hass = hass
|
||||
self._sensor_value_template = sensor_value_template
|
||||
|
||||
self._state = None
|
||||
|
|
Loading…
Add table
Reference in a new issue