mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 14:15:12 +02:00
Add timeout to auto detect config
This commit is contained in:
@@ -907,7 +907,8 @@ class Config(object):
|
|||||||
_LOGGER.info('Auto detecting location and temperature unit')
|
_LOGGER.info('Auto detecting location and temperature unit')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
info = requests.get('https://freegeoip.net/json/').json()
|
info = requests.get(
|
||||||
|
'https://freegeoip.net/json/', timeout=5).json()
|
||||||
except requests.RequestException:
|
except requests.RequestException:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user