Add scripts editor backend (#8993)

* Add scripts editor backend

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

No files matched your search

+19
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