diff --git a/homeassistant/components/notify/slack.py b/homeassistant/components/notify/slack.py index 99d0c4ef663..39ca0197d0f 100644 --- a/homeassistant/components/notify/slack.py +++ b/homeassistant/components/notify/slack.py @@ -51,7 +51,15 @@ class SlackNotificationService(BaseNotificationService): import slacker channel = kwargs.get('target') or self._default_channel + data = kwargs.get('data') + if data: + attachments = data.get('attachments') + else: + attachments = None + try: - self.slack.chat.post_message(channel, message, as_user=True) + self.slack.chat.post_message(channel, message, + as_user=True, + attachments=attachments) except slacker.Error: _LOGGER.exception("Could not send slack notification")