Remove service helper (8) (#17055)

* Updated keyboard

* Updated microsoft_face

* Updated ffmpeg

* Updated logger

* Updated components/__init__.py
This commit is contained in:
cdce8p 2018-10-02 10:23:37 +02:00 committed by Paulus Schoutsen
parent 13af61e103
commit 90f71261c5
9 changed files with 193 additions and 167 deletions

View file

@ -1,8 +1,9 @@
"""Provide configuration end points for Customize."""
from homeassistant.components.config import EditKeyBasedConfigView
from homeassistant.components import async_reload_core_config
from homeassistant.components import SERVICE_RELOAD_CORE_CONFIG
from homeassistant.config import DATA_CUSTOMIZE
from homeassistant.core import DOMAIN
import homeassistant.helpers.config_validation as cv
@ -11,9 +12,13 @@ CONFIG_PATH = 'customize.yaml'
async def async_setup(hass):
"""Set up the Customize config API."""
async def hook(hass):
"""post_write_hook for Config View that reloads groups."""
await hass.services.async_call(DOMAIN, SERVICE_RELOAD_CORE_CONFIG)
hass.http.register_view(CustomizeConfigView(
'customize', 'config', CONFIG_PATH, cv.entity_id, dict,
post_write_hook=async_reload_core_config
post_write_hook=hook
))
return True