Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.slack.notify Namespace Reference

Classes

class  AuthDictT
 
class  FormDataT
 
class  MessageT
 
class  SlackNotificationService
 

Functions

str _async_get_filename_from_url (str url)
 
list[str] _async_sanitize_channel_names (list[str] channel_list)
 
SlackNotificationService|None async_get_service (HomeAssistant hass, ConfigType config, DiscoveryInfoType|None discovery_info=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 DATA_FILE_SCHEMA
 
 DATA_SCHEMA
 
 DATA_TEXT_ONLY_SCHEMA
 
 FILE_PATH_SCHEMA = vol.Schema({vol.Required(CONF_PATH): cv.isfile})
 
 FILE_URL_SCHEMA
 

Detailed Description

Slack platform for notify component.

Function Documentation

◆ _async_get_filename_from_url()

str homeassistant.components.slack.notify._async_get_filename_from_url ( str  url)
private
Return the filename of a passed URL.

Definition at line 121 of file notify.py.

◆ _async_sanitize_channel_names()

list[str] homeassistant.components.slack.notify._async_sanitize_channel_names ( list[str]  channel_list)
private
Remove any # symbols from a channel list.

Definition at line 128 of file notify.py.

◆ async_get_service()

SlackNotificationService | None homeassistant.components.slack.notify.async_get_service ( HomeAssistant  hass,
ConfigType  config,
DiscoveryInfoType | None   discovery_info = None 
)
Set up the Slack notification service.

Definition at line 105 of file notify.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.slack.notify._LOGGER = logging.getLogger(__name__)
private

Definition at line 42 of file notify.py.

◆ DATA_FILE_SCHEMA

homeassistant.components.slack.notify.DATA_FILE_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(ATTR_FILE): vol.Any(FILE_PATH_SCHEMA, FILE_URL_SCHEMA),
4  vol.Optional(ATTR_THREAD_TS): cv.string,
5  }
6 )

Definition at line 54 of file notify.py.

◆ DATA_SCHEMA

homeassistant.components.slack.notify.DATA_SCHEMA
Initial value:
1 = vol.All(
2  cv.ensure_list, [vol.Any(DATA_FILE_SCHEMA, DATA_TEXT_ONLY_SCHEMA)]
3 )

Definition at line 71 of file notify.py.

◆ DATA_TEXT_ONLY_SCHEMA

homeassistant.components.slack.notify.DATA_TEXT_ONLY_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(ATTR_USERNAME): cv.string,
4  vol.Optional(ATTR_ICON): cv.string,
5  vol.Optional(ATTR_BLOCKS): list,
6  vol.Optional(ATTR_BLOCKS_TEMPLATE): list,
7  vol.Optional(ATTR_THREAD_TS): cv.string,
8  }
9 )

Definition at line 61 of file notify.py.

◆ FILE_PATH_SCHEMA

homeassistant.components.slack.notify.FILE_PATH_SCHEMA = vol.Schema({vol.Required(CONF_PATH): cv.isfile})

Definition at line 44 of file notify.py.

◆ FILE_URL_SCHEMA

homeassistant.components.slack.notify.FILE_URL_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(ATTR_URL): cv.url,
4  vol.Inclusive(ATTR_USERNAME, "credentials"): cv.string,
5  vol.Inclusive(ATTR_PASSWORD, "credentials"): cv.string,
6  }
7 )

Definition at line 46 of file notify.py.