From 5e3e7304960a53b848e40cc377a0c2e9b3dadb35 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 29 Apr 2019 09:54:42 -0700 Subject: [PATCH] Install requirements when checking config (#23500) * Install requirements when checking config * PyLint --- homeassistant/scripts/check_config.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/homeassistant/scripts/check_config.py b/homeassistant/scripts/check_config.py index 4bdda85bc07..5fe4e95a480 100644 --- a/homeassistant/scripts/check_config.py +++ b/homeassistant/scripts/check_config.py @@ -11,7 +11,7 @@ from unittest.mock import patch import attr import voluptuous as vol -from homeassistant import bootstrap, core, loader +from homeassistant import bootstrap, core, loader, requirements from homeassistant.config import ( get_default_config_dir, CONF_CORE, CORE_CONFIG_SCHEMA, CONF_PACKAGES, merge_packages_config, _format_config_error, @@ -344,6 +344,13 @@ async def check_ha_config_file(hass): result.add_error("Component not found: {}".format(domain)) continue + if (not hass.config.skip_pip and integration.requirements and + not await requirements.async_process_requirements( + hass, integration.domain, integration.requirements)): + result.add_error("Unable to install all requirements: {}".format( + ', '.join(integration.requirements))) + continue + if hasattr(component, 'CONFIG_SCHEMA'): try: config = component.CONFIG_SCHEMA(config)