From da6986e58c7414ed492c9345b97b9277cd7e5245 Mon Sep 17 00:00:00 2001 From: Alex Hermann Date: Sun, 19 Oct 2025 21:50:46 +0200 Subject: [PATCH] Allow overriding recipients per message in XMPP (#149375) Co-authored-by: Joost Lekkerkerker --- homeassistant/components/xmpp/notify.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/xmpp/notify.py b/homeassistant/components/xmpp/notify.py index ca622ec670ab..e1d6b9b11609 100644 --- a/homeassistant/components/xmpp/notify.py +++ b/homeassistant/components/xmpp/notify.py @@ -15,6 +15,8 @@ import requests import voluptuous as vol from homeassistant.components.notify import ( + ATTR_DATA, + ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA, @@ -44,7 +46,6 @@ if sys.version_info < (3, 14): _LOGGER = logging.getLogger(__name__) -ATTR_DATA = "data" ATTR_PATH = "path" ATTR_PATH_TEMPLATE = "path_template" ATTR_TIMEOUT = "timeout" @@ -112,13 +113,14 @@ class XmppNotificationService(BaseNotificationService): """Send a message to a user.""" title = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT) text = f"{title}: {message}" if title else message + targets = kwargs.get(ATTR_TARGET, self._recipients) data = kwargs.get(ATTR_DATA) timeout = data.get(ATTR_TIMEOUT, XEP_0363_TIMEOUT) if data else None await async_send_message( f"{self._sender}/{self._resource}", self._password, - self._recipients, + targets, self._tls, self._verify, self._room,