1
mirror of https://github.com/home-assistant/core synced 2024-07-12 07:21:24 +02:00

Pass the real config for Slack (#76960)

This commit is contained in:
Robert Hillis 2022-08-17 22:41:28 -04:00 committed by GitHub
parent 03fac0c529
commit 280ae91ba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -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],
)
)

View File

@ -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"