* Update notify to expect a list of string targets instead of a single string
* Actually do the thing I set out to do
* Fix notify.group test to expect an array of targets
* REST platform will only use the first target in the list
* Update notify platforms to expect a list of targets
* Update notify services.yaml
* Add support for notifying with Slack messages.
When creating notifications, this allows you to pass in `attachments`
with the `data`. It's an array of attachments as defined in
https://api.slack.com/docs/message-attachments
When passing in attachments, message is still required, but it's okay to
be a blank string.
* Split over multiple lines
* Make sure attachments gets assigned, even if there isn't attachment data
Current documentation suggests to use personal API tokens. This isn't
ideal because for a few reasons:
* messages will come as your own user, so it's hard to tell it's coming
from hass
* it's harder to manage if multiple people are using Slack and home
* assistant, since you'd have to coordinate rolling of it
It is possible to use Slack bot users already. Just make a new one from https://your-team.slack.com/apps/build/custom-integration, and use the token for that. You can even add an icon from the web frontend for home assistant.
However, the message will appear as a bot without a name or icon. This pull requests fixes this by passing the as_user parameter, which uses the bot user's name and icon.
One caveat is you need to invite the bot user into the room you want to
post to. This probably was an issue before though.
🎩 to @jnewland who pointed me to this in his branch