Move imports to top for nextbus (#29520)

* Move imports to top for nextbus

* Fix test_sensor.py failed tests
This commit is contained in:
springstan 2019-12-05 21:56:42 +01:00 committed by Franck Nijhof
parent 42688a6e4a
commit 20fdcbadff
2 changed files with 18 additions and 16 deletions

View file

@ -1,13 +1,13 @@
"""NextBus sensor."""
import logging
from itertools import chain
import logging
from py_nextbus import NextBusClient
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
from homeassistant.const import DEVICE_CLASS_TIMESTAMP
from homeassistant.const import CONF_NAME, DEVICE_CLASS_TIMESTAMP
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util.dt import utc_from_timestamp
@ -94,8 +94,6 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
stop = config[CONF_STOP]
name = config.get(CONF_NAME)
from py_nextbus import NextBusClient
client = NextBusClient(output_format="json")
# Ensures that the tags provided are valid, also logs out valid values