Add check_config helper (#24557)

* check_config

* no ignore

* tests

* try tests again
This commit is contained in:
Johann Kellerman
2019-07-10 20:56:50 +02:00
committed by Paulus Schoutsen
parent 236debb455
commit 2e26f0bd2b
7 changed files with 342 additions and 178 deletions

View File

@@ -745,13 +745,13 @@ async def async_check_ha_config_file(hass: HomeAssistant) -> Optional[str]:
This method is a coroutine.
"""
from homeassistant.scripts.check_config import check_ha_config_file
import homeassistant.helpers.check_config as check_config
res = await check_ha_config_file(hass) # type: ignore
res = await check_config.async_check_ha_config_file(hass)
if not res.errors:
return None
return '\n'.join([err.message for err in res.errors])
return res.error_str
@callback