From 280ae91ba17aa7ed98eec2f41607969a03685b2f Mon Sep 17 00:00:00 2001 From: Robert Hillis Date: Wed, 17 Aug 2022 22:41:28 -0400 Subject: [PATCH] Pass the real config for Slack (#76960) --- homeassistant/components/slack/__init__.py | 6 ++++-- homeassistant/components/slack/const.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/slack/__init__.py b/homeassistant/components/slack/__init__.py index ae52013621fc..a89f645e9b69 100644 --- a/homeassistant/components/slack/__init__.py +++ b/homeassistant/components/slack/__init__.py @@ -12,7 +12,7 @@ from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers import aiohttp_client, discovery from homeassistant.helpers.typing import ConfigType -from .const import DATA_CLIENT, DOMAIN +from .const import DATA_CLIENT, DATA_HASS_CONFIG, DOMAIN _LOGGER = logging.getLogger(__name__) @@ -21,6 +21,8 @@ PLATFORMS = [Platform.NOTIFY] async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Slack component.""" + hass.data[DATA_HASS_CONFIG] = config + # Iterate all entries for notify to only get Slack if Platform.NOTIFY in config: for entry in config[Platform.NOTIFY]: @@ -55,7 +57,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: Platform.NOTIFY, DOMAIN, hass.data[DOMAIN][entry.entry_id], - hass.data[DOMAIN], + hass.data[DATA_HASS_CONFIG], ) ) diff --git a/homeassistant/components/slack/const.py b/homeassistant/components/slack/const.py index b7b5707aeebb..83937f4a43e7 100644 --- a/homeassistant/components/slack/const.py +++ b/homeassistant/components/slack/const.py @@ -14,3 +14,5 @@ CONF_DEFAULT_CHANNEL = "default_channel" DATA_CLIENT = "client" DEFAULT_TIMEOUT_SECONDS = 15 DOMAIN: Final = "slack" + +DATA_HASS_CONFIG = "slack_hass_config"