Check import

This commit is contained in:
Fabian Affolter 2015-10-24 00:34:49 +02:00
parent 1e0e48fcd7
commit c19120e012

View file

@ -21,7 +21,13 @@ _LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the Radio Thermostat. """
import radiotherm
try:
import radiotherm
except ImportError:
_LOGGER.exception(
"Unable to import radiotherm. "
"Did you maybe not install the 'radiotherm' package?")
return False
hosts = []
if CONF_HOST in config: