8000 Move imports to top for environment_canada by springstan · Pull Request #29458 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Move imports to top for environment_canada #29458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions homeassistant/components/environment_canada/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
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__)

Expand Down Expand Up @@ -46,7 +47,6 @@

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(
Expand Down
10 changes: 5 additions & 5 deletions homeassistant/components/environment_canada/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@
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__)

Expand Down Expand Up @@ -56,7 +57,6 @@ def validate_station(station):

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(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/environment_canada/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
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__)

Expand Down
0