From b0bb1258601502f8da31c13ddd710ef6ee9c3a6f Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Mon, 13 Apr 2020 15:32:23 -0600 Subject: [PATCH] Fix deprecated icon/username logic in Slack (#34156) * Fix deprecated icon/username logic in Slack * hassfest --- homeassistant/components/slack/notify.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/slack/notify.py b/homeassistant/components/slack/notify.py index fe6f7ab0d26..8cfffc1722a 100644 --- a/homeassistant/components/slack/notify.py +++ b/homeassistant/components/slack/notify.py @@ -74,11 +74,7 @@ class SlackNotificationService(BaseNotificationService): self._default_channel = default_channel self._hass = hass self._icon = icon - - if username or self._icon: - self._as_user = False - else: - self._as_user = True + self._username = username async def _async_send_local_file_message(self, path, targets, message, title): """Upload a local file (with message) to Slack.""" @@ -108,11 +104,11 @@ class SlackNotificationService(BaseNotificationService): target: self._client.chat_postMessage( channel=target, text=message, - as_user=self._as_user, attachments=attachments, blocks=blocks, icon_emoji=self._icon, link_names=True, + username=self._username, ) for target in targets }