Move imports to top for opensensemap ()

pull/29381/head
springstan 2019-12-04 00:44:04 +01:00 committed by Paulus Schoutsen
parent e26eebfc19
commit 9d213e70f0
1 changed files with 2 additions and 2 deletions
homeassistant/components/opensensemap

View File

@ -2,6 +2,8 @@
from datetime import timedelta
import logging
from opensensemap_api import OpenSenseMap
from opensensemap_api.exceptions import OpenSenseMapError
import voluptuous as vol
from homeassistant.components.air_quality import PLATFORM_SCHEMA, AirQualityEntity
@ -26,7 +28,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the openSenseMap air quality platform."""
from opensensemap_api import OpenSenseMap
name = config.get(CONF_NAME)
station_id = config[CONF_STATION_ID]
@ -88,7 +89,6 @@ class OpenSenseMapData:
@Throttle(SCAN_INTERVAL)
async def async_update(self):
"""Get the latest data from the Pi-hole."""
from opensensemap_api.exceptions import OpenSenseMapError
try:
await self.api.get_data()