From 4d0265cb7d6ba1a147517bad04d1f0b687bea6e0 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 24 Apr 2015 20:57:25 -0700 Subject: [PATCH 1/2] Add timeout to auto detect config --- homeassistant/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/__init__.py b/homeassistant/__init__.py index 5e54cbd5d0a..05bbb9b40ff 100644 --- a/homeassistant/__init__.py +++ b/homeassistant/__init__.py @@ -907,7 +907,8 @@ class Config(object): _LOGGER.info('Auto detecting location and temperature unit') try: - info = requests.get('https://freegeoip.net/json/').json() + info = requests.get( + 'https://freegeoip.net/json/', timeout=5).json() except requests.RequestException: return From a9006f540fc7730fe3253f8efc0b048045618f9d Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 25 Apr 2015 06:07:07 -0700 Subject: [PATCH 2/2] Fix #102 - Installing PyISY no longer required to load any light --- homeassistant/components/isy994.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/isy994.py b/homeassistant/components/isy994.py index f6ecebb9b2c..24b45e6f058 100644 --- a/homeassistant/components/isy994.py +++ b/homeassistant/components/isy994.py @@ -6,9 +6,6 @@ devices. Also contains the base classes for ISY Sensors, Lights, and Switches. import logging from urllib.parse import urlparse -# addon library imports -import PyISY - # homeassistant imports from homeassistant import bootstrap from homeassistant.loader import get_component @@ -37,6 +34,13 @@ def setup(hass, config): Setup isy994 component. This will automatically import associated lights, switches, and sensors. """ + try: + import PyISY + except ImportError: + _LOGGER.error("Error while importing dependency PyISY.") + + return False + # pylint: disable=global-statement # check for required values in configuration file if not validate_config(config,