Move imports to top for mhz19 (#29478)

pull/29495/head
springstan 2019-12-05 06:14:03 +01:00 committed by Paulus Schoutsen
parent 653e0078a4
commit 7df4c1e676
1 changed files with 6 additions and 6 deletions

View File

@ -1,20 +1,21 @@
"""Support for CO2 sensor connected to a serial port."""
import logging
from datetime import timedelta
import logging
from pmsensor import co2sensor
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_TEMPERATURE,
CONF_NAME,
CONF_MONITORED_CONDITIONS,
CONF_NAME,
TEMP_FAHRENHEIT,
)
from homeassistant.helpers.entity import Entity
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.util.temperature import celsius_to_fahrenheit
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
from homeassistant.util.temperature import celsius_to_fahrenheit
_LOGGER = logging.getLogger(__name__)
@ -41,7 +42,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the available CO2 sensors."""
from pmsensor import co2sensor
try:
co2sensor.read_mh_z19(config.get(CONF_SERIAL_DEVICE))