Add scripts editor backend (#8993)

* Add scripts editor backend

* Fix docstrings
This commit is contained in:
Paulus Schoutsen 2017-08-15 22:09:10 -07:00 committed by GitHub
parent 95c57412ff
commit 2dab239021
4 changed files with 45 additions and 10 deletions

View file

@ -0,0 +1,19 @@
"""Provide configuration end points for scripts."""
import asyncio
from homeassistant.components.config import EditKeyBasedConfigView
from homeassistant.components.script import SCRIPT_ENTRY_SCHEMA, async_reload
import homeassistant.helpers.config_validation as cv
CONFIG_PATH = 'scripts.yaml'
@asyncio.coroutine
def async_setup(hass):
"""Set up the script config API."""
hass.http.register_view(EditKeyBasedConfigView(
'script', 'config', CONFIG_PATH, cv.slug, SCRIPT_ENTRY_SCHEMA,
post_write_hook=async_reload
))
return True