mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Remove unnecessary assignment of Template.hass from notify (#123680)
This commit is contained in:
parent
b04e3dc6fd
commit
268044cd01
@ -91,14 +91,12 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
async def persistent_notification(service: ServiceCall) -> None:
|
||||
"""Send notification via the built-in persistent_notify integration."""
|
||||
message: Template = service.data[ATTR_MESSAGE]
|
||||
message.hass = hass
|
||||
check_templates_warn(hass, message)
|
||||
|
||||
title = None
|
||||
title_tpl: Template | None
|
||||
if title_tpl := service.data.get(ATTR_TITLE):
|
||||
check_templates_warn(hass, title_tpl)
|
||||
title_tpl.hass = hass
|
||||
title = title_tpl.async_render(parse_result=False)
|
||||
|
||||
notification_id = None
|
||||
|
@ -259,7 +259,6 @@ class BaseNotificationService:
|
||||
title: Template | None
|
||||
if title := service.data.get(ATTR_TITLE):
|
||||
check_templates_warn(self.hass, title)
|
||||
title.hass = self.hass
|
||||
kwargs[ATTR_TITLE] = title.async_render(parse_result=False)
|
||||
|
||||
if self.registered_targets.get(service.service) is not None:
|
||||
@ -268,7 +267,6 @@ class BaseNotificationService:
|
||||
kwargs[ATTR_TARGET] = service.data.get(ATTR_TARGET)
|
||||
|
||||
check_templates_warn(self.hass, message)
|
||||
message.hass = self.hass
|
||||
kwargs[ATTR_MESSAGE] = message.async_render(parse_result=False)
|
||||
kwargs[ATTR_DATA] = service.data.get(ATTR_DATA)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user