From c6fd8582a9a8d084358b55f4810e8d145cc1deb0 Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Wed, 4 Dec 2019 11:14:35 +0100 Subject: [PATCH] Move imports to top for lyft (#29391) --- homeassistant/components/lyft/sensor.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/lyft/sensor.py b/homeassistant/components/lyft/sensor.py index 339b996c5d8..1b90d66398e 100644 --- a/homeassistant/components/lyft/sensor.py +++ b/homeassistant/components/lyft/sensor.py @@ -1,13 +1,16 @@ """Support for the Lyft API.""" -import logging from datetime import timedelta +import logging +from lyft_rides.auth import ClientCredentialGrant +from lyft_rides.client import LyftRidesClient +from lyft_rides.errors import APIError import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA +import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.util import Throttle -import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) @@ -38,8 +41,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Lyft sensor.""" - from lyft_rides.auth import ClientCredentialGrant - from lyft_rides.errors import APIError auth_flow = ClientCredentialGrant( client_id=config.get(CONF_CLIENT_ID), @@ -208,7 +209,6 @@ class LyftEstimate: @Throttle(MIN_TIME_BETWEEN_UPDATES) def update(self): """Get the latest product info and estimates from the Lyft API.""" - from lyft_rides.errors import APIError try: self.fetch_data() @@ -217,7 +217,6 @@ class LyftEstimate: def fetch_data(self): """Get the latest product info and estimates from the Lyft API.""" - from lyft_rides.client import LyftRidesClient client = LyftRidesClient(self._session)