diff --git a/homeassistant/components/input_text.py b/homeassistant/components/input_text.py index 583181fe453..a9df7c15ea3 100755 --- a/homeassistant/components/input_text.py +++ b/homeassistant/components/input_text.py @@ -4,12 +4,14 @@ Component to offer a way to enter a value into a text box. For more details about this component, please refer to the documentation at https://home-assistant.io/components/input_text/ """ +import os import asyncio import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv +from homeassistant.config import load_yaml_config_file from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_UNIT_OF_MEASUREMENT, CONF_ICON, CONF_NAME) from homeassistant.loader import bind_hass @@ -110,8 +112,13 @@ def async_setup(hass, config): if tasks: yield from asyncio.wait(tasks, loop=hass.loop) + descriptions = yield from hass.async_add_job( + load_yaml_config_file, os.path.join( + os.path.dirname(__file__), 'services.yaml')) + hass.services.async_register( DOMAIN, SERVICE_SET_VALUE, async_set_value_service, + description=descriptions[DOMAIN][SERVICE_SET_VALUE], schema=SERVICE_SET_VALUE_SCHEMA) yield from component.async_add_entities(entities) diff --git a/homeassistant/components/services.yaml b/homeassistant/components/services.yaml index 36b141a1189..37829142e0c 100644 --- a/homeassistant/components/services.yaml +++ b/homeassistant/components/services.yaml @@ -453,6 +453,17 @@ input_boolean: description: Entity id of the input boolean to turn on. example: 'input_boolean.notify_alerts' +input_text: + set_value: + description: Set the value of an input text entity. + fields: + entity_id: + description: Entity id of the input text to set the new value. + example: 'input_text.text1' + value: + description: The target value the entity should be set to. + example: This is an example text + input_number: set_value: description: Set the value of an input number entity.