Add timeout to auto detect config

This commit is contained in:
Paulus Schoutsen 2015-04-24 20:57:25 -07:00
parent 24bb89df23
commit 4d0265cb7d

View file

@ -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