mirror of
https://github.com/home-assistant/core.git
synced 2025-11-13 13:00:11 +00:00
Input Select - Added service description (#11456)
This commit is contained in:
@@ -6,12 +6,14 @@ at https://home-assistant.io/components/input_select/
|
||||
"""
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import ATTR_ENTITY_ID, CONF_ICON, CONF_NAME
|
||||
from homeassistant.loader import bind_hass
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.config import load_yaml_config_file
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.entity_component import EntityComponent
|
||||
from homeassistant.helpers.restore_state import async_get_last_state
|
||||
@@ -129,6 +131,11 @@ def async_setup(hass, config):
|
||||
if not entities:
|
||||
return False
|
||||
|
||||
descriptions = yield from hass.async_add_job(
|
||||
load_yaml_config_file, os.path.join(
|
||||
os.path.dirname(__file__), 'services.yaml')
|
||||
)
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_select_option_service(call):
|
||||
"""Handle a calls to the input select option service."""
|
||||
@@ -141,6 +148,7 @@ def async_setup(hass, config):
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN, SERVICE_SELECT_OPTION, async_select_option_service,
|
||||
descriptions[DOMAIN][SERVICE_SELECT_OPTION],
|
||||
schema=SERVICE_SELECT_OPTION_SCHEMA)
|
||||
|
||||
@asyncio.coroutine
|
||||
@@ -155,6 +163,7 @@ def async_setup(hass, config):
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN, SERVICE_SELECT_NEXT, async_select_next_service,
|
||||
descriptions[DOMAIN][SERVICE_SELECT_NEXT],
|
||||
schema=SERVICE_SELECT_NEXT_SCHEMA)
|
||||
|
||||
@asyncio.coroutine
|
||||
@@ -169,6 +178,7 @@ def async_setup(hass, config):
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN, SERVICE_SELECT_PREVIOUS, async_select_previous_service,
|
||||
descriptions[DOMAIN][SERVICE_SELECT_PREVIOUS],
|
||||
schema=SERVICE_SELECT_PREVIOUS_SCHEMA)
|
||||
|
||||
@asyncio.coroutine
|
||||
@@ -183,6 +193,7 @@ def async_setup(hass, config):
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN, SERVICE_SET_OPTIONS, async_set_options_service,
|
||||
descriptions[DOMAIN][SERVICE_SET_OPTIONS],
|
||||
schema=SERVICE_SET_OPTIONS_SCHEMA)
|
||||
|
||||
yield from component.async_add_entities(entities)
|
||||
|
||||
Reference in New Issue
Block a user