Suppress specific import errors in the loader
This commit is contained in:
parent
5fe50066a6
commit
7938cbffd4
1 changed files with 7 additions and 4 deletions
|
@ -132,7 +132,10 @@ def get_component(comp_name):
|
||||||
|
|
||||||
return module
|
return module
|
||||||
|
|
||||||
except ImportError:
|
except ImportError as err:
|
||||||
|
# This error happens if for example custom_components/switch
|
||||||
|
# exists and we try to load switch.demo.
|
||||||
|
if str(err) != "No module named '{}'".format(path):
|
||||||
_LOGGER.exception(
|
_LOGGER.exception(
|
||||||
("Error loading %s. Make sure all "
|
("Error loading %s. Make sure all "
|
||||||
"dependencies are installed"), path)
|
"dependencies are installed"), path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue