Move imports in waqi component (#27450)
This commit is contained in:
parent
d516bc44fa
commit
af4bcf8de6
1 changed files with 2 additions and 2 deletions
|
@ -5,6 +5,7 @@ from datetime import timedelta
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
from waqiasync import WaqiClient
|
||||||
|
|
||||||
from homeassistant.exceptions import PlatformNotReady
|
from homeassistant.exceptions import PlatformNotReady
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
@ -60,13 +61,12 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||||
|
|
||||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||||
"""Set up the requested World Air Quality Index locations."""
|
"""Set up the requested World Air Quality Index locations."""
|
||||||
import waqiasync
|
|
||||||
|
|
||||||
token = config.get(CONF_TOKEN)
|
token = config.get(CONF_TOKEN)
|
||||||
station_filter = config.get(CONF_STATIONS)
|
station_filter = config.get(CONF_STATIONS)
|
||||||
locations = config.get(CONF_LOCATIONS)
|
locations = config.get(CONF_LOCATIONS)
|
||||||
|
|
||||||
client = waqiasync.WaqiClient(token, async_get_clientsession(hass), timeout=TIMEOUT)
|
client = WaqiClient(token, async_get_clientsession(hass), timeout=TIMEOUT)
|
||||||
dev = []
|
dev = []
|
||||||
try:
|
try:
|
||||||
for location_name in locations:
|
for location_name in locations:
|
||||||
|
|
Loading…
Add table
Reference in a new issue