mirror of
https://github.com/home-assistant/core
synced 2024-08-02 23:40:32 +02:00
Pass the real config for Slack (#76960)
This commit is contained in:
parent
03fac0c529
commit
280ae91ba1
@ -12,7 +12,7 @@ from homeassistant.exceptions import ConfigEntryNotReady
|
|||||||
from homeassistant.helpers import aiohttp_client, discovery
|
from homeassistant.helpers import aiohttp_client, discovery
|
||||||
from homeassistant.helpers.typing import ConfigType
|
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__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -21,6 +21,8 @@ PLATFORMS = [Platform.NOTIFY]
|
|||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||||
"""Set up the Slack component."""
|
"""Set up the Slack component."""
|
||||||
|
hass.data[DATA_HASS_CONFIG] = config
|
||||||
|
|
||||||
# Iterate all entries for notify to only get Slack
|
# Iterate all entries for notify to only get Slack
|
||||||
if Platform.NOTIFY in config:
|
if Platform.NOTIFY in config:
|
||||||
for entry in config[Platform.NOTIFY]:
|
for entry in config[Platform.NOTIFY]:
|
||||||
@ -55,7 +57,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
Platform.NOTIFY,
|
Platform.NOTIFY,
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
hass.data[DOMAIN][entry.entry_id],
|
hass.data[DOMAIN][entry.entry_id],
|
||||||
hass.data[DOMAIN],
|
hass.data[DATA_HASS_CONFIG],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -14,3 +14,5 @@ CONF_DEFAULT_CHANNEL = "default_channel"
|
|||||||
DATA_CLIENT = "client"
|
DATA_CLIENT = "client"
|
||||||
DEFAULT_TIMEOUT_SECONDS = 15
|
DEFAULT_TIMEOUT_SECONDS = 15
|
||||||
DOMAIN: Final = "slack"
|
DOMAIN: Final = "slack"
|
||||||
|
|
||||||
|
DATA_HASS_CONFIG = "slack_hass_config"
|
||||||
|
Loading…
Reference in New Issue
Block a user