Add scripts editor backend (#8993)
* Add scripts editor backend * Fix docstrings
This commit is contained in:
parent
95c57412ff
commit
2dab239021
4 changed files with 45 additions and 10 deletions
19
homeassistant/components/config/script.py
Normal file
19
homeassistant/components/config/script.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue