From 09b53a0d5582c241c5fdd68a442df13e7f1614fd Mon Sep 17 00:00:00 2001 From: Steven Barnes Date: Sat, 3 Sep 2016 18:44:30 -0500 Subject: [PATCH] Adding link_names to post.message call (#3167) If you do not turn link_names on, Slack will not highlight @channel and @username messages. --- homeassistant/components/notify/slack.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/notify/slack.py b/homeassistant/components/notify/slack.py index e49862b06da..10564609390 100644 --- a/homeassistant/components/notify/slack.py +++ b/homeassistant/components/notify/slack.py @@ -58,14 +58,12 @@ class SlackNotificationService(BaseNotificationService): channel = kwargs.get('target') or self._default_channel data = kwargs.get('data') - if data: - attachments = data.get('attachments') - else: - attachments = None + attachments = data.get('attachments') if data else None try: self.slack.chat.post_message(channel, message, as_user=True, - attachments=attachments) + attachments=attachments, + link_names=True) except slacker.Error as err: _LOGGER.error("Could not send slack notification. Error: %s", err)