Move imports to top for tof (#29203)

* Move imports to top for tof

* Isorted imports
This commit is contained in:
springstan 2019-11-29 01:58:56 +01:00 committed by Martin Hjelmare
parent 7b33e57e86
commit 0e4920d6a1

View File

@ -1,15 +1,16 @@
"""Platform for Time of Flight sensor VL53L1X from STMicroelectronics.""" """Platform for Time of Flight sensor VL53L1X from STMicroelectronics."""
import asyncio import asyncio
import logging
from functools import partial from functools import partial
import logging
from VL53L1X2 import VL53L1X # pylint: disable=import-error
import voluptuous as vol import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
import homeassistant.helpers.config_validation as cv
from homeassistant.components import rpi_gpio from homeassistant.components import rpi_gpio
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -51,7 +52,6 @@ def init_tof_1(xshut):
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):
"""Reset and initialize the VL53L1X ToF Sensor from STMicroelectronics.""" """Reset and initialize the VL53L1X ToF Sensor from STMicroelectronics."""
from VL53L1X2 import VL53L1X # pylint: disable=import-error
name = config.get(CONF_NAME) name = config.get(CONF_NAME)
bus_number = config.get(CONF_I2C_BUS) bus_number = config.get(CONF_I2C_BUS)