From 6f1e49b00dbd86aaef8e30365a5a4d9cd7af00b3 Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Fri, 3 May 2024 15:01:58 +0200 Subject: [PATCH] Add title param to notify send_message service - add blog post (#2163) * Add notify title option to send_message service * Rephrase --- blog/2024-05-03-notify-title.md | 20 ++++++++++++++++++++ docs/core/entity/notify.md | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 blog/2024-05-03-notify-title.md diff --git a/blog/2024-05-03-notify-title.md b/blog/2024-05-03-notify-title.md new file mode 100644 index 00000000..d2609a13 --- /dev/null +++ b/blog/2024-05-03-notify-title.md @@ -0,0 +1,20 @@ +--- +author: Jan Bouwhuis +authorURL: https://github.com/jbouwh +authorImageURL: https://avatars.githubusercontent.com/u/7188918?s=96&v=4 +title: Second phase of notify entity platform implementation +--- + +### Title option for send_message service notify entity platform + +Recently we added the notify [entity platform](https://developers.home-assistant.io/docs/core/entity/notify/). The new `notify` platform method implements service `send_message`. This service now also accepts an optional `title` as an argument. This allows some new integrations that can be migrated now to use the new entity platform: + +- cisco_webex_teams +- file +- sendgrid +- syslog +- tibber + +The [architecture discussion](https://github.com/home-assistant/architecture/discussions/1041) is still ongoing. + +When integrations are migrated, users will need to use the new `notify.send_message` service, so the migration changes will cause automations to break after the deprecation period is over. diff --git a/docs/core/entity/notify.md b/docs/core/entity/notify.md index 701e97cc..04e58ba6 100644 --- a/docs/core/entity/notify.md +++ b/docs/core/entity/notify.md @@ -32,9 +32,9 @@ The send message method is used to send a message to a device or service. class MyNotifier(NotifyEntity): # Implement one of these methods. - def send_message(self, message: str) -> None: + def send_message(self, message: str, title: str | None = None) -> None: """Send a message.""" - async def async_send_message(self, message: str) -> None: + async def async_send_message(self, message: str, title: str | None = None) -> None: """Send a message.""" ```