Skip to content

Commit

Permalink
Move imports to top for smhi (#29545)
Browse files Browse the repository at this point in the history
  • Loading branch information
springstan authored and frenck committed Dec 6, 2019
1 parent a857148 commit 1bb499a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/smhi/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config flow to configure SMHI component."""
from smhi.smhi_lib import Smhi, SmhiForecastException
import voluptuous as vol

from homeassistant import config_entries
Expand Down Expand Up @@ -96,7 +97,6 @@ async def _show_config_form(

async def _check_location(self, longitude: str, latitude: str) -> bool:
"""Return true if location is ok."""
from smhi.smhi_lib import Smhi, SmhiForecastException

try:
session = aiohttp_client.async_get_clientsession(self.hass)
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/smhi/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import aiohttp
import async_timeout
from smhi import Smhi
from smhi.smhi_lib import SmhiForecastException

from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
Expand Down Expand Up @@ -90,7 +92,6 @@ def __init__(
session: aiohttp.ClientSession = None,
) -> None:
"""Initialize the SMHI weather entity."""
from smhi import Smhi

self._name = name
self._latitude = latitude
Expand All @@ -107,7 +108,6 @@ def unique_id(self) -> str:
@Throttle(MIN_TIME_BETWEEN_UPDATES)
async def async_update(self) -> None:
"""Refresh the forecast data from SMHI weather API."""
from smhi.smhi_lib import SmhiForecastException

def fail():
"""Postpone updates."""
Expand Down

0 comments on commit 1bb499a

Please sign in to comment.