Use assignment expressions 28 (#58189)

This commit is contained in:
Marc Mueller 2021-10-22 14:06:04 +02:00 committed by GitHub
parent a3d1159a13
commit eab235173b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 30 additions and 61 deletions

View file

@ -202,9 +202,8 @@ class BaseNotificationService:
"""Handle sending notification message service calls."""
kwargs = {}
message = service.data[ATTR_MESSAGE]
title = service.data.get(ATTR_TITLE)
if title:
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)