Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions homeassistant/components/automation/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
import voluptuous as vol

from homeassistant.core import callback
from homeassistant.const import CONF_PLATFORM
from homeassistant.const import CONF_PLATFORM, CONF_WEBHOOK_ID
import homeassistant.helpers.config_validation as cv

DEPENDENCIES = ('webhook',)

_LOGGER = logging.getLogger(__name__)
CONF_WEBHOOK_ID = 'webhook_id'

TRIGGER_SCHEMA = vol.Schema({
vol.Required(CONF_PLATFORM): 'webhook',
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/ifttt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import homeassistant.helpers.config_validation as cv
from homeassistant import config_entries
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.util.network import is_local

REQUIREMENTS = ['pyfttt==0.3']
Expand All @@ -29,7 +30,6 @@
ATTR_VALUE3 = 'value3'

CONF_KEY = 'key'
CONF_WEBHOOK_ID = 'webhook_id'

DOMAIN = 'ifttt'

Expand Down Expand Up @@ -91,13 +91,13 @@ async def handle_webhook(hass, webhook_id, request):
async def async_setup_entry(hass, entry):
"""Configure based on config entry."""
hass.components.webhook.async_register(
entry.data['webhook_id'], handle_webhook)
entry.data[CONF_WEBHOOK_ID], handle_webhook)
return True


async def async_unload_entry(hass, entry):
"""Unload a config entry."""
hass.components.webhook.async_unregister(entry.data['webhook_id'])
hass.components.webhook.async_unregister(entry.data[CONF_WEBHOOK_ID])
return True


Expand Down
1 change: 1 addition & 0 deletions homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
CONF_USERNAME = 'username'
CONF_VALUE_TEMPLATE = 'value_template'
CONF_VERIFY_SSL = 'verify_ssl'
CONF_WEBHOOK_ID = 'webhook_id'
CONF_WEEKDAY = 'weekday'
CONF_WHITELIST = 'whitelist'
CONF_WHITELIST_EXTERNAL_DIRS = 'whitelist_external_dirs'
Expand Down