mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 16:38:16 +01:00
Fix component loader value error (#149)
* Print better error message when loader fails with ValueError * Improve * Improve
This commit is contained in:
parent
7ce753b76f
commit
0374b3a0b3
1 changed files with 2 additions and 2 deletions
|
@ -28,7 +28,7 @@ def get_component(domain):
|
||||||
path = 'esphomeyaml.components.{}'.format(domain)
|
path = 'esphomeyaml.components.{}'.format(domain)
|
||||||
try:
|
try:
|
||||||
module = importlib.import_module(path)
|
module = importlib.import_module(path)
|
||||||
except ImportError as err:
|
except (ImportError, ValueError) as err:
|
||||||
_LOGGER.debug(err)
|
_LOGGER.debug(err)
|
||||||
else:
|
else:
|
||||||
_COMPONENT_CACHE[domain] = module
|
_COMPONENT_CACHE[domain] = module
|
||||||
|
@ -183,7 +183,7 @@ def validate_config(config):
|
||||||
p_domain = u'{}.{}'.format(domain, p_name)
|
p_domain = u'{}.{}'.format(domain, p_name)
|
||||||
platform = get_platform(domain, p_name)
|
platform = get_platform(domain, p_name)
|
||||||
if platform is None:
|
if platform is None:
|
||||||
result.add_error(u"Platform not found: {}".format(p_domain), p_domain, p_config)
|
result.add_error(u"Platform not found: '{}'".format(p_domain), p_domain, p_config)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
success = True
|
success = True
|
||||||
|
|
Loading…
Reference in a new issue