mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-12 11:56:29 +00:00
Add title param to notify send_message service - add blog post (#2163)
* Add notify title option to send_message service * Rephrase
This commit is contained in:
parent
0177ff3741
commit
6f1e49b00d
20
blog/2024-05-03-notify-title.md
Normal file
20
blog/2024-05-03-notify-title.md
Normal file
@ -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.
|
@ -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."""
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user