Async syntax 2, camera & climate & config (#17016)

This commit is contained in:
cdce8p authored and Paulus Schoutsen committed 2018-10-01 08:50:05 +02:00
1 parent 38e371c5d9
commit 8444b9ba03
22 files changed
+119 -194

No files matched your search

+3 -6
View File
@@ -1,12 +1,10 @@
"""Component to interact with Hassbian tools."""
import asyncio
from homeassistant.components.http import HomeAssistantView
from homeassistant.config import async_check_ha_config_file
@asyncio.coroutine
def async_setup(hass):
async def async_setup(hass):
"""Set up the Hassbian config."""
hass.http.register_view(CheckConfigView)
return True
@@ -18,10 +16,9 @@ class CheckConfigView(HomeAssistantView):
url = '/api/config/core/check_config'
name = 'api:config:core:check_config'
@asyncio.coroutine
def post(self, request):
async def post(self, request):
"""Validate configuration and return results."""
errors = yield from async_check_ha_config_file(request.app['hass'])
errors = await async_check_ha_config_file(request.app['hass'])
state = 'invalid' if errors else 'valid'