Home Assistant Unofficial Reference 2024.12.1
__init__.py
Go to the documentation of this file.
1 """The notify_events component."""
2 
3 import voluptuous as vol
4 
5 from homeassistant.const import CONF_TOKEN, Platform
6 from homeassistant.core import HomeAssistant
7 from homeassistant.helpers import discovery
9 from homeassistant.helpers.typing import ConfigType
10 
11 from .const import DOMAIN
12 
13 CONFIG_SCHEMA = vol.Schema(
14  {DOMAIN: vol.Schema({vol.Required(CONF_TOKEN): cv.string})}, extra=vol.ALLOW_EXTRA
15 )
16 
17 
18 def setup(hass: HomeAssistant, config: ConfigType) -> bool:
19  """Set up the notify_events component."""
20 
21  hass.data[DOMAIN] = config[DOMAIN]
22  discovery.load_platform(hass, Platform.NOTIFY, DOMAIN, {}, config)
23  return True
bool setup(HomeAssistant hass, ConfigType config)
Definition: __init__.py:18