mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Move imports in google_travel_time component (#27381)
This commit is contained in:
parent
fc7a20d180
commit
99885b9acf
@ -1,25 +1,25 @@
|
|||||||
"""Support for Google travel time sensors."""
|
"""Support for Google travel time sensors."""
|
||||||
|
from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
from datetime import datetime
|
|
||||||
from datetime import timedelta
|
|
||||||
|
|
||||||
|
import googlemaps
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
import homeassistant.util.dt as dt_util
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_API_KEY,
|
ATTR_ATTRIBUTION,
|
||||||
CONF_NAME,
|
|
||||||
EVENT_HOMEASSISTANT_START,
|
|
||||||
ATTR_LATITUDE,
|
ATTR_LATITUDE,
|
||||||
ATTR_LONGITUDE,
|
ATTR_LONGITUDE,
|
||||||
ATTR_ATTRIBUTION,
|
CONF_API_KEY,
|
||||||
CONF_MODE,
|
CONF_MODE,
|
||||||
|
CONF_NAME,
|
||||||
|
EVENT_HOMEASSISTANT_START,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers import location
|
from homeassistant.helpers import location
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
import homeassistant.util.dt as dt_util
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -203,8 +203,6 @@ class GoogleTravelTimeSensor(Entity):
|
|||||||
else:
|
else:
|
||||||
self._destination = destination
|
self._destination = destination
|
||||||
|
|
||||||
import googlemaps
|
|
||||||
|
|
||||||
self._client = googlemaps.Client(api_key, timeout=10)
|
self._client = googlemaps.Client(api_key, timeout=10)
|
||||||
try:
|
try:
|
||||||
self.update()
|
self.update()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user