mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Remove unnecessary assignment of Template.hass from service helper (#123710)
This commit is contained in:
parent
6caec89793
commit
c5e8710889
@ -365,7 +365,6 @@ def async_prepare_call_from_config(
|
|||||||
|
|
||||||
if isinstance(domain_service, template.Template):
|
if isinstance(domain_service, template.Template):
|
||||||
try:
|
try:
|
||||||
domain_service.hass = hass
|
|
||||||
domain_service = domain_service.async_render(variables)
|
domain_service = domain_service.async_render(variables)
|
||||||
domain_service = cv.service(domain_service)
|
domain_service = cv.service(domain_service)
|
||||||
except TemplateError as ex:
|
except TemplateError as ex:
|
||||||
@ -384,10 +383,8 @@ def async_prepare_call_from_config(
|
|||||||
conf = config[CONF_TARGET]
|
conf = config[CONF_TARGET]
|
||||||
try:
|
try:
|
||||||
if isinstance(conf, template.Template):
|
if isinstance(conf, template.Template):
|
||||||
conf.hass = hass
|
|
||||||
target.update(conf.async_render(variables))
|
target.update(conf.async_render(variables))
|
||||||
else:
|
else:
|
||||||
template.attach(hass, conf)
|
|
||||||
target.update(template.render_complex(conf, variables))
|
target.update(template.render_complex(conf, variables))
|
||||||
|
|
||||||
if CONF_ENTITY_ID in target:
|
if CONF_ENTITY_ID in target:
|
||||||
@ -413,7 +410,6 @@ def async_prepare_call_from_config(
|
|||||||
if conf not in config:
|
if conf not in config:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
template.attach(hass, config[conf])
|
|
||||||
render = template.render_complex(config[conf], variables)
|
render = template.render_complex(config[conf], variables)
|
||||||
if not isinstance(render, dict):
|
if not isinstance(render, dict):
|
||||||
raise HomeAssistantError(
|
raise HomeAssistantError(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user