Async syntax 2, camera & climate & config (#17016)
This commit is contained in:
1 parent
38e371c5d9
commit
8444b9ba03
22 files changed
+119
-194
No files matched your search
@@ -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'
|
||||
|
||||
|
||||
Reference in new issue
Block a user