Async syntax 2, camera & climate & config (#17016)
This commit is contained in:
parent
38e371c5d9
commit
8444b9ba03
22 changed files with 119 additions and 194 deletions
|
@ -1,5 +1,4 @@
|
|||
"""Provide configuration end points for Groups."""
|
||||
import asyncio
|
||||
from homeassistant.const import SERVICE_RELOAD
|
||||
from homeassistant.components.config import EditKeyBasedConfigView
|
||||
from homeassistant.components.group import DOMAIN, GROUP_SCHEMA
|
||||
|
@ -9,13 +8,11 @@ import homeassistant.helpers.config_validation as cv
|
|||
CONFIG_PATH = 'groups.yaml'
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_setup(hass):
|
||||
async def async_setup(hass):
|
||||
"""Set up the Group config API."""
|
||||
@asyncio.coroutine
|
||||
def hook(hass):
|
||||
async def hook(hass):
|
||||
"""post_write_hook for Config View that reloads groups."""
|
||||
yield from hass.services.async_call(DOMAIN, SERVICE_RELOAD)
|
||||
await hass.services.async_call(DOMAIN, SERVICE_RELOAD)
|
||||
|
||||
hass.http.register_view(EditKeyBasedConfigView(
|
||||
'group', 'config', CONFIG_PATH, cv.slug, GROUP_SCHEMA,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue