mirror of
https://github.com/home-assistant/core
synced 2024-09-03 08:14:07 +02:00
Move imports to top for ipma (#29507)
This commit is contained in:
parent
204ca3f3a6
commit
2a92eb1962
@ -1,5 +1,6 @@
|
||||
"""Component for the Portuguese weather service - IPMA."""
|
||||
from homeassistant.core import Config, HomeAssistant
|
||||
|
||||
from .config_flow import IpmaFlowHandler # noqa: F401
|
||||
from .const import DOMAIN # noqa: F401
|
||||
|
||||
|
@ -1,22 +1,23 @@
|
||||
"""Support for IPMA weather service."""
|
||||
import logging
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
import async_timeout
|
||||
from pyipma import Station
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.weather import (
|
||||
WeatherEntity,
|
||||
PLATFORM_SCHEMA,
|
||||
ATTR_FORECAST_CONDITION,
|
||||
ATTR_FORECAST_PRECIPITATION,
|
||||
ATTR_FORECAST_TEMP,
|
||||
ATTR_FORECAST_TEMP_LOW,
|
||||
ATTR_FORECAST_TIME,
|
||||
PLATFORM_SCHEMA,
|
||||
WeatherEntity,
|
||||
)
|
||||
from homeassistant.const import CONF_NAME, TEMP_CELSIUS, CONF_LATITUDE, CONF_LONGITUDE
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME, TEMP_CELSIUS
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.util import Throttle
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@ -84,7 +85,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
|
||||
async def async_get_station(hass, latitude, longitude):
|
||||
"""Retrieve weather station, station name to be used as the entity name."""
|
||||
from pyipma import Station
|
||||
|
||||
websession = async_get_clientsession(hass)
|
||||
with async_timeout.timeout(10):
|
||||
|
Loading…
Reference in New Issue
Block a user