mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix schemas and update ordering (#2932)
This commit is contained in:
parent
b6da4a53d5
commit
fb639e08d7
@ -11,17 +11,17 @@ from homeassistant.const import HTTP_BAD_REQUEST
|
|||||||
from homeassistant.helpers import template, script
|
from homeassistant.helpers import template, script
|
||||||
from homeassistant.components.http import HomeAssistantView
|
from homeassistant.components.http import HomeAssistantView
|
||||||
|
|
||||||
DOMAIN = 'alexa'
|
|
||||||
DEPENDENCIES = ['http']
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
API_ENDPOINT = '/api/alexa'
|
API_ENDPOINT = '/api/alexa'
|
||||||
|
|
||||||
CONF_INTENTS = 'intents'
|
|
||||||
CONF_CARD = 'card'
|
|
||||||
CONF_SPEECH = 'speech'
|
|
||||||
CONF_ACTION = 'action'
|
CONF_ACTION = 'action'
|
||||||
|
CONF_CARD = 'card'
|
||||||
|
CONF_INTENTS = 'intents'
|
||||||
|
CONF_SPEECH = 'speech'
|
||||||
|
|
||||||
|
DOMAIN = 'alexa'
|
||||||
|
DEPENDENCIES = ['http']
|
||||||
|
|
||||||
|
|
||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
|
@ -25,7 +25,7 @@ CONFIG_SCHEMA = vol.Schema({
|
|||||||
DOMAIN: vol.Schema({
|
DOMAIN: vol.Schema({
|
||||||
vol.Required(CONF_PORT): cv.string,
|
vol.Required(CONF_PORT): cv.string,
|
||||||
}),
|
}),
|
||||||
})
|
}, extra=vol.ALLOW_EXTRA)
|
||||||
|
|
||||||
|
|
||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
|
@ -11,26 +11,26 @@ import logging
|
|||||||
from homeassistant.const import EVENT_TIME_CHANGED, ATTR_FRIENDLY_NAME
|
from homeassistant.const import EVENT_TIME_CHANGED, ATTR_FRIENDLY_NAME
|
||||||
from homeassistant.helpers.entity import generate_entity_id
|
from homeassistant.helpers.entity import generate_entity_id
|
||||||
|
|
||||||
DOMAIN = "configurator"
|
|
||||||
ENTITY_ID_FORMAT = DOMAIN + ".{}"
|
|
||||||
|
|
||||||
SERVICE_CONFIGURE = "configure"
|
|
||||||
|
|
||||||
STATE_CONFIGURE = "configure"
|
|
||||||
STATE_CONFIGURED = "configured"
|
|
||||||
|
|
||||||
ATTR_LINK_NAME = "link_name"
|
|
||||||
ATTR_LINK_URL = "link_url"
|
|
||||||
ATTR_CONFIGURE_ID = "configure_id"
|
|
||||||
ATTR_DESCRIPTION = "description"
|
|
||||||
ATTR_DESCRIPTION_IMAGE = "description_image"
|
|
||||||
ATTR_SUBMIT_CAPTION = "submit_caption"
|
|
||||||
ATTR_FIELDS = "fields"
|
|
||||||
ATTR_ERRORS = "errors"
|
|
||||||
|
|
||||||
_REQUESTS = {}
|
|
||||||
_INSTANCES = {}
|
_INSTANCES = {}
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
_REQUESTS = {}
|
||||||
|
|
||||||
|
ATTR_CONFIGURE_ID = 'configure_id'
|
||||||
|
ATTR_DESCRIPTION = 'description'
|
||||||
|
ATTR_DESCRIPTION_IMAGE = 'description_image'
|
||||||
|
ATTR_ERRORS = 'errors'
|
||||||
|
ATTR_FIELDS = 'fields'
|
||||||
|
ATTR_LINK_NAME = 'link_name'
|
||||||
|
ATTR_LINK_URL = 'link_url'
|
||||||
|
ATTR_SUBMIT_CAPTION = 'submit_caption'
|
||||||
|
|
||||||
|
DOMAIN = 'configurator'
|
||||||
|
|
||||||
|
ENTITY_ID_FORMAT = DOMAIN + '.{}'
|
||||||
|
|
||||||
|
SERVICE_CONFIGURE = 'configure'
|
||||||
|
STATE_CONFIGURE = 'configure'
|
||||||
|
STATE_CONFIGURED = 'configured'
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-arguments
|
# pylint: disable=too-many-arguments
|
||||||
|
@ -15,20 +15,20 @@ from homeassistant.const import (
|
|||||||
ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON)
|
ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON)
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
DOMAIN = "conversation"
|
REQUIREMENTS = ['fuzzywuzzy==0.11.1']
|
||||||
|
|
||||||
SERVICE_PROCESS = "process"
|
ATTR_TEXT = 'text'
|
||||||
|
|
||||||
ATTR_TEXT = "text"
|
DOMAIN = 'conversation'
|
||||||
|
|
||||||
|
REGEX_TURN_COMMAND = re.compile(r'turn (?P<name>(?: |\w)+) (?P<command>\w+)')
|
||||||
|
|
||||||
|
SERVICE_PROCESS = 'process'
|
||||||
|
|
||||||
SERVICE_PROCESS_SCHEMA = vol.Schema({
|
SERVICE_PROCESS_SCHEMA = vol.Schema({
|
||||||
vol.Required(ATTR_TEXT): vol.All(cv.string, vol.Lower),
|
vol.Required(ATTR_TEXT): vol.All(cv.string, vol.Lower),
|
||||||
})
|
})
|
||||||
|
|
||||||
REGEX_TURN_COMMAND = re.compile(r'turn (?P<name>(?: |\w)+) (?P<command>\w+)')
|
|
||||||
|
|
||||||
REQUIREMENTS = ['fuzzywuzzy==0.11.1']
|
|
||||||
|
|
||||||
|
|
||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
"""Register the process service."""
|
"""Register the process service."""
|
||||||
|
@ -11,9 +11,8 @@ import homeassistant.core as ha
|
|||||||
import homeassistant.loader as loader
|
import homeassistant.loader as loader
|
||||||
from homeassistant.const import ATTR_ENTITY_ID, CONF_PLATFORM
|
from homeassistant.const import ATTR_ENTITY_ID, CONF_PLATFORM
|
||||||
|
|
||||||
DOMAIN = "demo"
|
|
||||||
|
|
||||||
DEPENDENCIES = ['conversation', 'introduction', 'zone']
|
DEPENDENCIES = ['conversation', 'introduction', 'zone']
|
||||||
|
DOMAIN = 'demo'
|
||||||
|
|
||||||
COMPONENTS_WITH_DEMO_PLATFORM = [
|
COMPONENTS_WITH_DEMO_PLATFORM = [
|
||||||
'alarm_control_panel',
|
'alarm_control_panel',
|
||||||
|
@ -12,13 +12,13 @@ import threading
|
|||||||
from homeassistant.const import EVENT_HOMEASSISTANT_START
|
from homeassistant.const import EVENT_HOMEASSISTANT_START
|
||||||
from homeassistant.helpers.discovery import load_platform, discover
|
from homeassistant.helpers.discovery import load_platform, discover
|
||||||
|
|
||||||
DOMAIN = "discovery"
|
|
||||||
REQUIREMENTS = ['netdisco==0.7.1']
|
REQUIREMENTS = ['netdisco==0.7.1']
|
||||||
|
|
||||||
SCAN_INTERVAL = 300 # seconds
|
DOMAIN = 'discovery'
|
||||||
|
|
||||||
SERVICE_WEMO = 'belkin_wemo'
|
SCAN_INTERVAL = 300 # seconds
|
||||||
SERVICE_NETGEAR = 'netgear_router'
|
SERVICE_NETGEAR = 'netgear_router'
|
||||||
|
SERVICE_WEMO = 'belkin_wemo'
|
||||||
|
|
||||||
SERVICE_HANDLERS = {
|
SERVICE_HANDLERS = {
|
||||||
SERVICE_NETGEAR: ('device_tracker', None),
|
SERVICE_NETGEAR: ('device_tracker', None),
|
||||||
|
@ -16,21 +16,20 @@ from homeassistant.helpers import validate_config
|
|||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.util import sanitize_filename
|
from homeassistant.util import sanitize_filename
|
||||||
|
|
||||||
DOMAIN = "downloader"
|
ATTR_SUBDIR = 'subdir'
|
||||||
|
ATTR_URL = 'url'
|
||||||
SERVICE_DOWNLOAD_FILE = "download_file"
|
|
||||||
|
|
||||||
ATTR_URL = "url"
|
|
||||||
ATTR_SUBDIR = "subdir"
|
|
||||||
|
|
||||||
SERVICE_DOWNLOAD_FILE_SCHEMA = vol.Schema({
|
|
||||||
# pylint: disable=no-value-for-parameter
|
|
||||||
vol.Required(ATTR_URL): vol.Url(),
|
|
||||||
vol.Optional(ATTR_SUBDIR): cv.string,
|
|
||||||
})
|
|
||||||
|
|
||||||
CONF_DOWNLOAD_DIR = 'download_dir'
|
CONF_DOWNLOAD_DIR = 'download_dir'
|
||||||
|
|
||||||
|
DOMAIN = 'downloader'
|
||||||
|
|
||||||
|
SERVICE_DOWNLOAD_FILE = 'download_file'
|
||||||
|
|
||||||
|
SERVICE_DOWNLOAD_FILE_SCHEMA = vol.Schema({
|
||||||
|
vol.Required(ATTR_URL): cv.url,
|
||||||
|
vol.Optional(ATTR_SUBDIR): cv.string,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-branches
|
# pylint: disable=too-many-branches
|
||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
|
@ -29,7 +29,7 @@ CONFIG_SCHEMA = vol.Schema({
|
|||||||
vol.Required(CONF_WHITELIST, default=[]):
|
vol.Required(CONF_WHITELIST, default=[]):
|
||||||
vol.All(cv.ensure_list, [cv.entity_id]),
|
vol.All(cv.ensure_list, [cv.entity_id]),
|
||||||
}),
|
}),
|
||||||
})
|
}, extra=vol.ALLOW_EXTRA)
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-locals
|
# pylint: disable=too-many-locals
|
||||||
|
Loading…
x
Reference in New Issue
Block a user