Move imports to top for rachio (#29323)

This commit is contained in:
springstan 2019-12-03 00:59:13 +01:00 committed by Martin Hjelmare
parent bacc549576
commit 9160d43a08

View File

@ -4,11 +4,13 @@ import logging
from typing import Optional from typing import Optional
from aiohttp import web from aiohttp import web
from rachiopy import Rachio
import voluptuous as vol import voluptuous as vol
from homeassistant.auth.util import generate_secret from homeassistant.auth.util import generate_secret
from homeassistant.components.http import HomeAssistantView from homeassistant.components.http import HomeAssistantView
from homeassistant.const import CONF_API_KEY, EVENT_HOMEASSISTANT_STOP, URL_API from homeassistant.const import CONF_API_KEY, EVENT_HOMEASSISTANT_STOP, URL_API
from homeassistant.helpers import discovery, config_validation as cv from homeassistant.helpers import config_validation as cv, discovery
from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.helpers.dispatcher import async_dispatcher_send
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -102,7 +104,6 @@ SIGNAL_RACHIO_SCHEDULE_UPDATE = SIGNAL_RACHIO_UPDATE + "_schedule"
def setup(hass, config) -> bool: def setup(hass, config) -> bool:
"""Set up the Rachio component.""" """Set up the Rachio component."""
from rachiopy import Rachio
# Listen for incoming webhook connections # Listen for incoming webhook connections
hass.http.register_view(RachioWebhookView()) hass.http.register_view(RachioWebhookView())