From 327cd5711bd90acdfd4db6ded61abca72e840602 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 1 Dec 2026 07:52:55 +0100 Subject: [PATCH] Use the action field enums in google_mail (#195725) --- homeassistant/components/google_mail/notify.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/google_mail/notify.py b/homeassistant/components/google_mail/notify.py index 4fa89b4615f5..5c3c220ed75d 100644 --- a/homeassistant/components/google_mail/notify.py +++ b/homeassistant/components/google_mail/notify.py @@ -8,11 +8,9 @@ from typing import Any, override from googleapiclient.http import HttpRequest from homeassistant.components.notify import ( - ATTR_DATA, - ATTR_TARGET, - ATTR_TITLE, ATTR_TITLE_DEFAULT, BaseNotificationService, + NotifyServiceArgument, ) from homeassistant.core import HomeAssistant from homeassistant.exceptions import ServiceValidationError @@ -50,11 +48,11 @@ class GMailNotificationService(BaseNotificationService): @override async def async_send_message(self, message: str, **kwargs: Any) -> None: """Send a message.""" - data: dict[str, Any] = kwargs.get(ATTR_DATA) or {} - title = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT) + data: dict[str, Any] = kwargs.get(NotifyServiceArgument.DATA) or {} + title = kwargs.get(NotifyServiceArgument.TITLE, ATTR_TITLE_DEFAULT) email = MIMEText(message, "html") - if to_addrs := kwargs.get(ATTR_TARGET): + if to_addrs := kwargs.get(NotifyServiceArgument.TARGET): email["To"] = ", ".join(to_addrs) email_from = data.get(ATTR_FROM, ATTR_ME)