Move imports to top for skybell (#29475)

This commit is contained in:
springstan 2019-12-05 06:13:49 +01:00 committed by Paulus Schoutsen
parent c6066d8b98
commit 653e0078a4

View File

@ -1,10 +1,11 @@
"""Support for the Skybell HD Doorbell.""" """Support for the Skybell HD Doorbell."""
import logging import logging
from requests.exceptions import HTTPError, ConnectTimeout from requests.exceptions import ConnectTimeout, HTTPError
from skybellpy import Skybell
import voluptuous as vol import voluptuous as vol
from homeassistant.const import ATTR_ATTRIBUTION, CONF_USERNAME, CONF_PASSWORD from homeassistant.const import ATTR_ATTRIBUTION, CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
@ -39,8 +40,6 @@ def setup(hass, config):
password = conf.get(CONF_PASSWORD) password = conf.get(CONF_PASSWORD)
try: try:
from skybellpy import Skybell
cache = hass.config.path(DEFAULT_CACHEDB) cache = hass.config.path(DEFAULT_CACHEDB)
skybell = Skybell( skybell = Skybell(
username=username, password=password, get_devices=True, cache_path=cache username=username, password=password, get_devices=True, cache_path=cache