Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass the real config for Slack #76960

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions homeassistant/components/slack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
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__)

Expand All @@ -21,6 +21,8 @@

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]:
Expand Down Expand Up @@ -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],
)
)

Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/slack/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
DATA_CLIENT = "client"
DEFAULT_TIMEOUT_SECONDS = 15
DOMAIN: Final = "slack"

DATA_HASS_CONFIG = "slack_hass_config"