Add Unify Circuit (#35756)
This commit is contained in:
1 parent
71ebf8738f
commit
1f3d3c3e5b
6 files changed
+87
No files matched your search
@@ -0,0 +1,38 @@
|
||||
"""The Unify Circuit component."""
|
||||
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import CONF_NAME, CONF_URL
|
||||
from homeassistant.helpers import config_validation as cv, discovery
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DOMAIN = "circuit"
|
||||
CONF_WEBHOOK = "webhook"
|
||||
|
||||
WEBHOOK_SCHEMA = vol.Schema(
|
||||
{vol.Optional(CONF_NAME): cv.string, vol.Required(CONF_URL): cv.string}
|
||||
)
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema(
|
||||
{
|
||||
DOMAIN: vol.Schema(
|
||||
{vol.Required(CONF_WEBHOOK): vol.All(cv.ensure_list, [WEBHOOK_SCHEMA])}
|
||||
)
|
||||
},
|
||||
extra=vol.ALLOW_EXTRA,
|
||||
)
|
||||
|
||||
|
||||
async def async_setup(hass, config):
|
||||
"""Set up the Unify Circuit component."""
|
||||
webhooks = config[DOMAIN][CONF_WEBHOOK]
|
||||
|
||||
for webhook_conf in webhooks:
|
||||
hass.async_create_task(
|
||||
discovery.async_load_platform(hass, "notify", DOMAIN, webhook_conf, config)
|
||||
)
|
||||
|
||||
return True
|
||||
Reference in new issue
Block a user