mirror of
https://github.com/home-assistant/core.git
synced 2025-04-26 02:07:54 +00:00
Merge remote-tracking branch 'upstream/dev'
This commit is contained in:
commit
97bb5bcb7d
@ -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
|
||||||
|
|
||||||
|
@ -6,9 +6,6 @@ devices. Also contains the base classes for ISY Sensors, Lights, and Switches.
|
|||||||
import logging
|
import logging
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
# addon library imports
|
|
||||||
import PyISY
|
|
||||||
|
|
||||||
# homeassistant imports
|
# homeassistant imports
|
||||||
from homeassistant import bootstrap
|
from homeassistant import bootstrap
|
||||||
from homeassistant.loader import get_component
|
from homeassistant.loader import get_component
|
||||||
@ -38,6 +35,13 @@ def setup(hass, config):
|
|||||||
Setup isy994 component.
|
Setup isy994 component.
|
||||||
This will automatically import associated lights, switches, and sensors.
|
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
|
# pylint: disable=global-statement
|
||||||
# check for required values in configuration file
|
# check for required values in configuration file
|
||||||
if not validate_config(config,
|
if not validate_config(config,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user