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