From 7938cbffd4ecc28b374bebaa130f5bbcfbbcf4bd Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 1 Mar 2015 10:40:07 -0800 Subject: [PATCH] Suppress specific import errors in the loader --- homeassistant/loader.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/homeassistant/loader.py b/homeassistant/loader.py index 528158f23c2..4000f11565d 100644 --- a/homeassistant/loader.py +++ b/homeassistant/loader.py @@ -132,10 +132,13 @@ def get_component(comp_name): return module - except ImportError: - _LOGGER.exception( - ("Error loading %s. Make sure all " - "dependencies are installed"), path) + 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( + ("Error loading %s. Make sure all " + "dependencies are installed"), path) _LOGGER.error("Unable to find component %s", comp_name)