Move imports to top for environment_canada (#29458)
parent
a4ac5dc6b8
commit
58ba6052e2
|
@ -7,17 +7,18 @@ https://home-assistant.io/components/camera.environment_canada/
|
|||
import datetime
|
||||
import logging
|
||||
|
||||
from env_canada import ECRadar
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
|
||||
from homeassistant.const import (
|
||||
CONF_NAME,
|
||||
ATTR_ATTRIBUTION,
|
||||
CONF_LATITUDE,
|
||||
CONF_LONGITUDE,
|
||||
ATTR_ATTRIBUTION,
|
||||
CONF_NAME,
|
||||
)
|
||||
from homeassistant.util import Throttle
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.util import Throttle
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -46,7 +47,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Set up the Environment Canada camera."""
|
||||
from env_canada import ECRadar
|
||||
|
||||
if config.get(CONF_STATION):
|
||||
radar_object = ECRadar(
|
||||
|
|
|
@ -8,18 +8,19 @@ from datetime import datetime, timedelta
|
|||
import logging
|
||||
import re
|
||||
|
||||
from env_canada import ECData
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import (
|
||||
TEMP_CELSIUS,
|
||||
CONF_LATITUDE,
|
||||
CONF_LONGITUDE,
|
||||
ATTR_ATTRIBUTION,
|
||||
ATTR_LOCATION,
|
||||
CONF_LATITUDE,
|
||||
CONF_LONGITUDE,
|
||||
TEMP_CELSIUS,
|
||||
)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -56,7 +57,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up the Environment Canada sensor."""
|
||||
from env_canada import ECData
|
||||
|
||||
if config.get(CONF_STATION):
|
||||
ec_data = ECData(
|
||||
|
|
|
@ -20,8 +20,8 @@ from homeassistant.components.weather import (
|
|||
WeatherEntity,
|
||||
)
|
||||
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME, TEMP_CELSIUS
|
||||
import homeassistant.util.dt as dt
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
import homeassistant.util.dt as dt
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
Loading…
Reference in New Issue