Warn when using custom components (#15172)

* Warn when using custom components

* Update text
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2018-06-27 15:21:32 -04:00
1 parent c0b6a857f7
commit 742144f401
2 files changed
+19 -1

No files matched your search

+9 -1
View File
@@ -81,7 +81,7 @@ def get_component(hass, comp_or_platform) -> Optional[ModuleType]:
potential_paths = ['custom_components.{}'.format(comp_or_platform),
'homeassistant.components.{}'.format(comp_or_platform)]
for path in potential_paths:
for index, path in enumerate(potential_paths):
try:
module = importlib.import_module(path)
@@ -100,6 +100,14 @@ def get_component(hass, comp_or_platform) -> Optional[ModuleType]:
cache[comp_or_platform] = module
if index == 0:
_LOGGER.warning(
'You are using a custom component for %s which has not '
'been tested by Home Assistant. This component might '
'cause stability problems, be sure to disable it if you '
'do experience issues with Home Assistant.',
comp_or_platform)
return module
except ImportError as err: